diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 4a65f2d2..71ae18cf 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,21 +1,29 @@ lockVersion: 2.0.0 id: ff6658aa-ae09-4bec-b500-5ba8bcd3a069 management: - docChecksum: e34dac84738ebf2d447ea2b9055a6eeb + docChecksum: e73920abd3a55e8d249592f2e3090574 docVersion: 0.0.3 - speakeasyVersion: 1.210.0 - generationVersion: 2.281.2 - releaseVersion: 0.0.1 - configChecksum: 43e7b0d6235d59536ceb6593087bfd44 + speakeasyVersion: 1.321.0 + generationVersion: 2.354.2 + releaseVersion: 0.1.1 + configChecksum: 32d07b03c4a1b8364852e49423957f33 features: java: + additionalDependencies: 0.1.0 constsAndDefaults: 0.1.1 - core: 3.15.0 + core: 3.26.0 flattening: 2.81.1 - globalSecurity: 2.82.4 + globalSecurity: 2.82.5 + globalSecurityCallbacks: 0.1.0 + globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.1 + globals: 2.82.1 methodServerURLs: 2.82.1 - nameOverrides: 2.81.2 + nameOverrides: 2.81.3 + nullables: 0.1.0 + sdkHooks: 0.1.0 + typeOverrides: 2.81.1 + unions: 0.0.4 generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/SecuritySource.java - src/main/java/lukehagar/plexapi/plexapi/SDKConfiguration.java @@ -24,16 +32,17 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/Video.java - src/main/java/lukehagar/plexapi/plexapi/Activities.java - src/main/java/lukehagar/plexapi/plexapi/Butler.java + - src/main/java/lukehagar/plexapi/plexapi/Plex.java - src/main/java/lukehagar/plexapi/plexapi/Hubs.java - src/main/java/lukehagar/plexapi/plexapi/Search.java - src/main/java/lukehagar/plexapi/plexapi/Library.java - src/main/java/lukehagar/plexapi/plexapi/Log.java - - src/main/java/lukehagar/plexapi/plexapi/Plex.java - src/main/java/lukehagar/plexapi/plexapi/Playlists.java - src/main/java/lukehagar/plexapi/plexapi/Authentication.java - src/main/java/lukehagar/plexapi/plexapi/Statistics.java - src/main/java/lukehagar/plexapi/plexapi/Sessions.java - src/main/java/lukehagar/plexapi/plexapi/Updater.java + - src/main/java/lukehagar/plexapi/plexapi/Watchlist.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsRequestBuilder.java @@ -54,6 +63,9 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskRequestBuilder.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataRequestBuilder.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequestBuilder.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchRequestBuilder.java @@ -69,12 +81,11 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenRequestBuilder.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailRequestBuilder.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequestBuilder.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistRequestBuilder.java @@ -87,6 +98,8 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsRequestBuilder.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsRequestBuilder.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsRequestBuilder.java @@ -94,6 +107,7 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesRequestBuilder.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistRequestBuilder.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/SDKMethodInterfaces.java - src/main/java/lukehagar/plexapi/plexapi/PlexAPI.java - .gitattributes @@ -107,10 +121,17 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/utils/BigDecimalString.java - src/main/java/lukehagar/plexapi/plexapi/utils/BigIntegerString.java - src/main/java/lukehagar/plexapi/plexapi/utils/Deserializers.java + - src/main/java/lukehagar/plexapi/plexapi/utils/EventStream.java + - src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamLineReader.java + - src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamMessage.java + - src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamReader.java - src/main/java/lukehagar/plexapi/plexapi/utils/FormMetadata.java - src/main/java/lukehagar/plexapi/plexapi/utils/HTTPClient.java - src/main/java/lukehagar/plexapi/plexapi/utils/HTTPRequest.java - src/main/java/lukehagar/plexapi/plexapi/utils/HeaderMetadata.java + - src/main/java/lukehagar/plexapi/plexapi/utils/Helpers.java + - src/main/java/lukehagar/plexapi/plexapi/utils/Hook.java + - src/main/java/lukehagar/plexapi/plexapi/utils/Hooks.java - src/main/java/lukehagar/plexapi/plexapi/utils/JSON.java - src/main/java/lukehagar/plexapi/plexapi/utils/LazySingletonValue.java - src/main/java/lukehagar/plexapi/plexapi/utils/Metadata.java @@ -129,116 +150,84 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/utils/SecurityMetadata.java - src/main/java/lukehagar/plexapi/plexapi/utils/SerializedBody.java - src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyHTTPClient.java - - src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyHTTPSecurityClient.java - src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyMetadata.java - src/main/java/lukehagar/plexapi/plexapi/utils/TypedObject.java - src/main/java/lukehagar/plexapi/plexapi/utils/Types.java - src/main/java/lukehagar/plexapi/plexapi/utils/Utils.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/AuthException.java - src/main/java/lukehagar/plexapi/plexapi/models/errors/SDKError.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/Errors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesServerResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Directory.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/MediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesServerResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Setting.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsServerResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Server.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesServerResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Device.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityServerResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountServerResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/MyPlex.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/MinSize.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Upscale.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListServerResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListServer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/State.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesActivitiesResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Context.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Activity.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksButlerResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/ButlerTask.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/ButlerTasks.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/TaskName.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/PathParamTaskName.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskResponse.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataResponse.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequest.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/Location.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponse.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequest.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenLocation.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/OnlyTransient.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsHubsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsMetadata.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Hub.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsMediaContainer.java @@ -246,8 +235,6 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamOnlyTransient.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsHubsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsPart.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMedia.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsGenre.java @@ -261,16 +248,10 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsSearchResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsPart.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMedia.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsGenre.java @@ -284,11 +265,7 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedLibraryResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Part.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Media.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Genre.java @@ -296,12 +273,10 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/Writer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Country.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Role.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/Metadata.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedMetadata.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesLibraryResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesLocation.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesDirectory.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesMediaContainer.java @@ -309,10 +284,8 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeDetails.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryLibraryResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryDirectory.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/Filter.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryFilter.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Sort.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Field.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryType.java @@ -322,11 +295,10 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Tag.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRequest.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/LibrarySectionID.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsPart.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMedia.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsGenre.java @@ -339,8 +311,6 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Type.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryRequest.java @@ -349,8 +319,6 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataLibraryResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Stream.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataPart.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMedia.java @@ -367,15 +335,21 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenLibraryResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenDirectory.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenMetadata.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckLibraryResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRequest.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentGenre.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentCountry.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentGuids.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRole.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/User.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentMetadata.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentMediaContainer.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckStream.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckPart.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMedia.java @@ -386,30 +360,12 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Level.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinPlexResponseBody.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/Location.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponseBody.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponseBody.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamType.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Smart.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistPlaylistsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistMetadata.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistResponseBody.java @@ -417,30 +373,20 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/PlaylistType.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamSmart.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsPlaylistsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsMetadata.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistPlaylistsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistMetadata.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsPlaylistsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsPart.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMedia.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsGenre.java @@ -453,190 +399,283 @@ generatedFiles: - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsPlaylistsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsMetadata.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Force.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenQueryParamType.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Scope.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsStatisticsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsDevice.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Account.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsMedia.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsSessionsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsRequest.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsResources.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsMediaContainer.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsResponse.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsRequest.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsDevice.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsAccount.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsBandwidth.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsMediaContainer.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsStream.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsPart.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMedia.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/User.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsUser.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Player.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Session.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMetadata.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistorySessionsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/Filter.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryRequest.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryMetadata.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsSessionsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/TranscodeSession.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionResponse.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusUpdaterResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Release.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusMediaContainer.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Download.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesResponse.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Tonight.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/Skip.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesRequest.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesErrors.java - - src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesResponse.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/PathParamFilter.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/Libtype.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeCollections.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeExternalMedia.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistRequest.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/Image.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/Metadata.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistResponse.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/Errors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerCapabilitiesResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerPreferencesErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerPreferencesResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetAvailableClientsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetAvailableClientsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetDevicesErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetDevicesResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerIdentityErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerIdentityResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMyPlexAccountErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMyPlexAccountResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResizedPhotoErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResizedPhotoResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerListErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerListResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkPlayedErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkPlayedResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkUnplayedErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkUnplayedResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlayProgressErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlayProgressResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTimelineErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTimelineResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StartUniversalTranscodeErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StartUniversalTranscodeResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerActivitiesErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerActivitiesResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/CancelServerActivitiesErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/CancelServerActivitiesResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetButlerTasksErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetButlerTasksResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StartAllTasksErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StartAllTasksResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StopAllTasksErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StopAllTasksResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StartTaskErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StartTaskResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTaskErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTaskResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetHomeDataErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetHomeDataResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPinErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPinResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTokenErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTokenResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetGlobalHubsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetGlobalHubsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryHubsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryHubsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformSearchErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformSearchResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformVoiceSearchErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformVoiceSearchResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSearchResultsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSearchResultsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetFileHashErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetFileHashResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetRecentlyAddedErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetRecentlyAddedResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibrariesErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibrariesResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/DeleteLibraryErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/DeleteLibraryResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryItemsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryItemsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/RefreshLibraryErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/RefreshLibraryResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/SearchLibraryErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/SearchLibraryResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataChildrenErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataChildrenResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetOnDeckErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetOnDeckResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/LogLineErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/LogLineResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/LogMultiLineErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/LogMultiLineResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/EnablePaperTrailErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/EnablePaperTrailResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/CreatePlaylistErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/CreatePlaylistResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/DeletePlaylistErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/DeletePlaylistResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlaylistErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlaylistResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistContentsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistContentsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/ClearPlaylistContentsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/ClearPlaylistContentsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/AddPlaylistContentsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/AddPlaylistContentsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/UploadPlaylistErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/UploadPlaylistResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTransientTokenErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTransientTokenResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSourceConnectionInformationErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSourceConnectionInformationResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetStatisticsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetStatisticsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResourcesStatisticsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResourcesStatisticsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetBandwidthStatisticsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetBandwidthStatisticsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionHistoryErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionHistoryResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTranscodeSessionsErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTranscodeSessionsResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTranscodeSessionErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTranscodeSessionResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetUpdateStatusErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetUpdateStatusResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/CheckForUpdatesErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/CheckForUpdatesResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/ApplyUpdatesErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/ApplyUpdatesResponseBody.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetWatchlistErrors.java + - src/main/java/lukehagar/plexapi/plexapi/models/errors/GetWatchlistResponseBody.java - src/main/java/lukehagar/plexapi/plexapi/models/shared/Security.java - - docs/models/operations/Errors.md - - docs/models/operations/GetServerCapabilitiesServerResponseBody.md - docs/models/operations/Directory.md - docs/models/operations/MediaContainer.md - docs/models/operations/GetServerCapabilitiesResponseBody.md - docs/models/operations/GetServerCapabilitiesResponse.md - - docs/models/operations/GetServerPreferencesErrors.md - - docs/models/operations/GetServerPreferencesServerResponseBody.md - docs/models/operations/Setting.md - docs/models/operations/GetServerPreferencesMediaContainer.md - docs/models/operations/GetServerPreferencesResponseBody.md - docs/models/operations/GetServerPreferencesResponse.md - - docs/models/operations/GetAvailableClientsErrors.md - - docs/models/operations/GetAvailableClientsServerResponseBody.md - docs/models/operations/Server.md - docs/models/operations/GetAvailableClientsMediaContainer.md - docs/models/operations/GetAvailableClientsResponseBody.md - docs/models/operations/GetAvailableClientsResponse.md - - docs/models/operations/GetDevicesErrors.md - - docs/models/operations/GetDevicesServerResponseBody.md - docs/models/operations/Device.md - docs/models/operations/GetDevicesMediaContainer.md - docs/models/operations/GetDevicesResponseBody.md - docs/models/operations/GetDevicesResponse.md - - docs/models/operations/GetServerIdentityErrors.md - - docs/models/operations/GetServerIdentityServerResponseBody.md - docs/models/operations/GetServerIdentityMediaContainer.md - docs/models/operations/GetServerIdentityResponseBody.md - docs/models/operations/GetServerIdentityResponse.md - - docs/models/operations/GetMyPlexAccountErrors.md - - docs/models/operations/GetMyPlexAccountServerResponseBody.md - docs/models/operations/MyPlex.md - docs/models/operations/GetMyPlexAccountResponseBody.md - docs/models/operations/GetMyPlexAccountResponse.md - docs/models/operations/MinSize.md - docs/models/operations/Upscale.md - docs/models/operations/GetResizedPhotoRequest.md - - docs/models/operations/GetResizedPhotoErrors.md - - docs/models/operations/GetResizedPhotoResponseBody.md - docs/models/operations/GetResizedPhotoResponse.md - - docs/models/operations/GetServerListErrors.md - - docs/models/operations/GetServerListServerResponseBody.md - docs/models/operations/GetServerListServer.md - docs/models/operations/GetServerListMediaContainer.md - docs/models/operations/GetServerListResponseBody.md - docs/models/operations/GetServerListResponse.md - docs/models/operations/MarkPlayedRequest.md - - docs/models/operations/MarkPlayedErrors.md - - docs/models/operations/MarkPlayedResponseBody.md - docs/models/operations/MarkPlayedResponse.md - docs/models/operations/MarkUnplayedRequest.md - - docs/models/operations/MarkUnplayedErrors.md - - docs/models/operations/MarkUnplayedResponseBody.md - docs/models/operations/MarkUnplayedResponse.md - docs/models/operations/UpdatePlayProgressRequest.md - - docs/models/operations/UpdatePlayProgressErrors.md - - docs/models/operations/UpdatePlayProgressResponseBody.md - docs/models/operations/UpdatePlayProgressResponse.md - docs/models/operations/State.md - docs/models/operations/GetTimelineRequest.md - - docs/models/operations/GetTimelineErrors.md - - docs/models/operations/GetTimelineResponseBody.md - docs/models/operations/GetTimelineResponse.md - docs/models/operations/StartUniversalTranscodeRequest.md - - docs/models/operations/StartUniversalTranscodeErrors.md - - docs/models/operations/StartUniversalTranscodeResponseBody.md - docs/models/operations/StartUniversalTranscodeResponse.md - - docs/models/operations/GetServerActivitiesErrors.md - - docs/models/operations/GetServerActivitiesActivitiesResponseBody.md - docs/models/operations/Context.md - docs/models/operations/Activity.md - docs/models/operations/GetServerActivitiesMediaContainer.md - docs/models/operations/GetServerActivitiesResponseBody.md - docs/models/operations/GetServerActivitiesResponse.md - docs/models/operations/CancelServerActivitiesRequest.md - - docs/models/operations/CancelServerActivitiesErrors.md - - docs/models/operations/CancelServerActivitiesResponseBody.md - docs/models/operations/CancelServerActivitiesResponse.md - - docs/models/operations/GetButlerTasksErrors.md - - docs/models/operations/GetButlerTasksButlerResponseBody.md - docs/models/operations/ButlerTask.md - docs/models/operations/ButlerTasks.md - docs/models/operations/GetButlerTasksResponseBody.md - docs/models/operations/GetButlerTasksResponse.md - - docs/models/operations/StartAllTasksErrors.md - - docs/models/operations/StartAllTasksResponseBody.md - docs/models/operations/StartAllTasksResponse.md - - docs/models/operations/StopAllTasksErrors.md - - docs/models/operations/StopAllTasksResponseBody.md - docs/models/operations/StopAllTasksResponse.md - docs/models/operations/TaskName.md - docs/models/operations/StartTaskRequest.md - - docs/models/operations/StartTaskErrors.md - - docs/models/operations/StartTaskResponseBody.md - docs/models/operations/StartTaskResponse.md - docs/models/operations/PathParamTaskName.md - docs/models/operations/StopTaskRequest.md - - docs/models/operations/StopTaskErrors.md - - docs/models/operations/StopTaskResponseBody.md - docs/models/operations/StopTaskResponse.md + - docs/models/operations/GetHomeDataResponseBody.md + - docs/models/operations/GetHomeDataResponse.md + - docs/models/operations/GetPinRequest.md + - docs/models/operations/Location.md + - docs/models/operations/GetPinResponseBody.md + - docs/models/operations/GetPinResponse.md + - docs/models/operations/GetTokenRequest.md + - docs/models/operations/GetTokenLocation.md + - docs/models/operations/GetTokenResponseBody.md + - docs/models/operations/GetTokenResponse.md - docs/models/operations/OnlyTransient.md - docs/models/operations/GetGlobalHubsRequest.md - - docs/models/operations/GetGlobalHubsErrors.md - - docs/models/operations/GetGlobalHubsHubsResponseBody.md - docs/models/operations/GetGlobalHubsMetadata.md - docs/models/operations/Hub.md - docs/models/operations/GetGlobalHubsMediaContainer.md @@ -644,8 +683,6 @@ generatedFiles: - docs/models/operations/GetGlobalHubsResponse.md - docs/models/operations/QueryParamOnlyTransient.md - docs/models/operations/GetLibraryHubsRequest.md - - docs/models/operations/GetLibraryHubsErrors.md - - docs/models/operations/GetLibraryHubsHubsResponseBody.md - docs/models/operations/GetLibraryHubsPart.md - docs/models/operations/GetLibraryHubsMedia.md - docs/models/operations/GetLibraryHubsGenre.md @@ -659,16 +696,10 @@ generatedFiles: - docs/models/operations/GetLibraryHubsResponseBody.md - docs/models/operations/GetLibraryHubsResponse.md - docs/models/operations/PerformSearchRequest.md - - docs/models/operations/PerformSearchErrors.md - - docs/models/operations/PerformSearchResponseBody.md - docs/models/operations/PerformSearchResponse.md - docs/models/operations/PerformVoiceSearchRequest.md - - docs/models/operations/PerformVoiceSearchErrors.md - - docs/models/operations/PerformVoiceSearchResponseBody.md - docs/models/operations/PerformVoiceSearchResponse.md - docs/models/operations/GetSearchResultsRequest.md - - docs/models/operations/GetSearchResultsErrors.md - - docs/models/operations/GetSearchResultsSearchResponseBody.md - docs/models/operations/GetSearchResultsPart.md - docs/models/operations/GetSearchResultsMedia.md - docs/models/operations/GetSearchResultsGenre.md @@ -682,11 +713,7 @@ generatedFiles: - docs/models/operations/GetSearchResultsResponseBody.md - docs/models/operations/GetSearchResultsResponse.md - docs/models/operations/GetFileHashRequest.md - - docs/models/operations/GetFileHashErrors.md - - docs/models/operations/GetFileHashResponseBody.md - docs/models/operations/GetFileHashResponse.md - - docs/models/operations/GetRecentlyAddedErrors.md - - docs/models/operations/GetRecentlyAddedLibraryResponseBody.md - docs/models/operations/Part.md - docs/models/operations/Media.md - docs/models/operations/Genre.md @@ -694,12 +721,10 @@ generatedFiles: - docs/models/operations/Writer.md - docs/models/operations/Country.md - docs/models/operations/Role.md - - docs/models/operations/Metadata.md + - docs/models/operations/GetRecentlyAddedMetadata.md - docs/models/operations/GetRecentlyAddedMediaContainer.md - docs/models/operations/GetRecentlyAddedResponseBody.md - docs/models/operations/GetRecentlyAddedResponse.md - - docs/models/operations/GetLibrariesErrors.md - - docs/models/operations/GetLibrariesLibraryResponseBody.md - docs/models/operations/GetLibrariesLocation.md - docs/models/operations/GetLibrariesDirectory.md - docs/models/operations/GetLibrariesMediaContainer.md @@ -707,10 +732,8 @@ generatedFiles: - docs/models/operations/GetLibrariesResponse.md - docs/models/operations/IncludeDetails.md - docs/models/operations/GetLibraryRequest.md - - docs/models/operations/GetLibraryErrors.md - - docs/models/operations/GetLibraryLibraryResponseBody.md - docs/models/operations/GetLibraryDirectory.md - - docs/models/operations/Filter.md + - docs/models/operations/GetLibraryFilter.md - docs/models/operations/Sort.md - docs/models/operations/Field.md - docs/models/operations/GetLibraryType.md @@ -720,11 +743,10 @@ generatedFiles: - docs/models/operations/GetLibraryResponseBody.md - docs/models/operations/GetLibraryResponse.md - docs/models/operations/DeleteLibraryRequest.md - - docs/models/operations/DeleteLibraryErrors.md - - docs/models/operations/DeleteLibraryResponseBody.md - docs/models/operations/DeleteLibraryResponse.md - docs/models/operations/Tag.md - docs/models/operations/GetLibraryItemsRequest.md + - docs/models/operations/LibrarySectionID.md - docs/models/operations/GetLibraryItemsPart.md - docs/models/operations/GetLibraryItemsMedia.md - docs/models/operations/GetLibraryItemsGenre.md @@ -737,8 +759,6 @@ generatedFiles: - docs/models/operations/GetLibraryItemsResponseBody.md - docs/models/operations/GetLibraryItemsResponse.md - docs/models/operations/RefreshLibraryRequest.md - - docs/models/operations/RefreshLibraryErrors.md - - docs/models/operations/RefreshLibraryResponseBody.md - docs/models/operations/RefreshLibraryResponse.md - docs/models/operations/Type.md - docs/models/operations/SearchLibraryRequest.md @@ -747,8 +767,6 @@ generatedFiles: - docs/models/operations/SearchLibraryResponseBody.md - docs/models/operations/SearchLibraryResponse.md - docs/models/operations/GetMetadataRequest.md - - docs/models/operations/GetMetadataErrors.md - - docs/models/operations/GetMetadataLibraryResponseBody.md - docs/models/operations/Stream.md - docs/models/operations/GetMetadataPart.md - docs/models/operations/GetMetadataMedia.md @@ -765,15 +783,21 @@ generatedFiles: - docs/models/operations/GetMetadataResponseBody.md - docs/models/operations/GetMetadataResponse.md - docs/models/operations/GetMetadataChildrenRequest.md - - docs/models/operations/GetMetadataChildrenErrors.md - - docs/models/operations/GetMetadataChildrenLibraryResponseBody.md - docs/models/operations/GetMetadataChildrenDirectory.md - docs/models/operations/GetMetadataChildrenMetadata.md - docs/models/operations/GetMetadataChildrenMediaContainer.md - docs/models/operations/GetMetadataChildrenResponseBody.md - docs/models/operations/GetMetadataChildrenResponse.md - - docs/models/operations/GetOnDeckErrors.md - - docs/models/operations/GetOnDeckLibraryResponseBody.md + - docs/models/operations/GetTopWatchedContentRequest.md + - docs/models/operations/GetTopWatchedContentGenre.md + - docs/models/operations/GetTopWatchedContentCountry.md + - docs/models/operations/GetTopWatchedContentGuids.md + - docs/models/operations/GetTopWatchedContentRole.md + - docs/models/operations/User.md + - docs/models/operations/GetTopWatchedContentMetadata.md + - docs/models/operations/GetTopWatchedContentMediaContainer.md + - docs/models/operations/GetTopWatchedContentResponseBody.md + - docs/models/operations/GetTopWatchedContentResponse.md - docs/models/operations/GetOnDeckStream.md - docs/models/operations/GetOnDeckPart.md - docs/models/operations/GetOnDeckMedia.md @@ -784,30 +808,12 @@ generatedFiles: - docs/models/operations/GetOnDeckResponse.md - docs/models/operations/Level.md - docs/models/operations/LogLineRequest.md - - docs/models/operations/LogLineErrors.md - - docs/models/operations/LogLineResponseBody.md - docs/models/operations/LogLineResponse.md - - docs/models/operations/LogMultiLineErrors.md - - docs/models/operations/LogMultiLineResponseBody.md - docs/models/operations/LogMultiLineResponse.md - - docs/models/operations/EnablePaperTrailErrors.md - - docs/models/operations/EnablePaperTrailResponseBody.md - docs/models/operations/EnablePaperTrailResponse.md - - docs/models/operations/GetPinRequest.md - - docs/models/operations/GetPinErrors.md - - docs/models/operations/GetPinPlexResponseBody.md - - docs/models/operations/Location.md - - docs/models/operations/GetPinResponseBody.md - - docs/models/operations/GetPinResponse.md - - docs/models/operations/GetTokenRequest.md - - docs/models/operations/GetTokenErrors.md - - docs/models/operations/GetTokenResponseBody.md - - docs/models/operations/GetTokenResponse.md - docs/models/operations/QueryParamType.md - docs/models/operations/Smart.md - docs/models/operations/CreatePlaylistRequest.md - - docs/models/operations/CreatePlaylistErrors.md - - docs/models/operations/CreatePlaylistPlaylistsResponseBody.md - docs/models/operations/CreatePlaylistMetadata.md - docs/models/operations/CreatePlaylistMediaContainer.md - docs/models/operations/CreatePlaylistResponseBody.md @@ -815,30 +821,20 @@ generatedFiles: - docs/models/operations/PlaylistType.md - docs/models/operations/QueryParamSmart.md - docs/models/operations/GetPlaylistsRequest.md - - docs/models/operations/GetPlaylistsErrors.md - - docs/models/operations/GetPlaylistsPlaylistsResponseBody.md - docs/models/operations/GetPlaylistsMetadata.md - docs/models/operations/GetPlaylistsMediaContainer.md - docs/models/operations/GetPlaylistsResponseBody.md - docs/models/operations/GetPlaylistsResponse.md - docs/models/operations/GetPlaylistRequest.md - - docs/models/operations/GetPlaylistErrors.md - - docs/models/operations/GetPlaylistPlaylistsResponseBody.md - docs/models/operations/GetPlaylistMetadata.md - docs/models/operations/GetPlaylistMediaContainer.md - docs/models/operations/GetPlaylistResponseBody.md - docs/models/operations/GetPlaylistResponse.md - docs/models/operations/DeletePlaylistRequest.md - - docs/models/operations/DeletePlaylistErrors.md - - docs/models/operations/DeletePlaylistResponseBody.md - docs/models/operations/DeletePlaylistResponse.md - docs/models/operations/UpdatePlaylistRequest.md - - docs/models/operations/UpdatePlaylistErrors.md - - docs/models/operations/UpdatePlaylistResponseBody.md - docs/models/operations/UpdatePlaylistResponse.md - docs/models/operations/GetPlaylistContentsRequest.md - - docs/models/operations/GetPlaylistContentsErrors.md - - docs/models/operations/GetPlaylistContentsPlaylistsResponseBody.md - docs/models/operations/GetPlaylistContentsPart.md - docs/models/operations/GetPlaylistContentsMedia.md - docs/models/operations/GetPlaylistContentsGenre.md @@ -851,84 +847,209 @@ generatedFiles: - docs/models/operations/GetPlaylistContentsResponseBody.md - docs/models/operations/GetPlaylistContentsResponse.md - docs/models/operations/ClearPlaylistContentsRequest.md - - docs/models/operations/ClearPlaylistContentsErrors.md - - docs/models/operations/ClearPlaylistContentsResponseBody.md - docs/models/operations/ClearPlaylistContentsResponse.md - docs/models/operations/AddPlaylistContentsRequest.md - - docs/models/operations/AddPlaylistContentsErrors.md - - docs/models/operations/AddPlaylistContentsPlaylistsResponseBody.md - docs/models/operations/AddPlaylistContentsMetadata.md - docs/models/operations/AddPlaylistContentsMediaContainer.md - docs/models/operations/AddPlaylistContentsResponseBody.md - docs/models/operations/AddPlaylistContentsResponse.md - docs/models/operations/Force.md - docs/models/operations/UploadPlaylistRequest.md - - docs/models/operations/UploadPlaylistErrors.md - - docs/models/operations/UploadPlaylistResponseBody.md - docs/models/operations/UploadPlaylistResponse.md - docs/models/operations/GetTransientTokenQueryParamType.md - docs/models/operations/Scope.md - docs/models/operations/GetTransientTokenRequest.md - - docs/models/operations/GetTransientTokenErrors.md - - docs/models/operations/GetTransientTokenResponseBody.md - docs/models/operations/GetTransientTokenResponse.md - docs/models/operations/GetSourceConnectionInformationRequest.md - - docs/models/operations/GetSourceConnectionInformationErrors.md - - docs/models/operations/GetSourceConnectionInformationResponseBody.md - docs/models/operations/GetSourceConnectionInformationResponse.md - docs/models/operations/GetStatisticsRequest.md - - docs/models/operations/GetStatisticsErrors.md - - docs/models/operations/GetStatisticsStatisticsResponseBody.md - docs/models/operations/GetStatisticsDevice.md - docs/models/operations/Account.md - docs/models/operations/StatisticsMedia.md - docs/models/operations/GetStatisticsMediaContainer.md - docs/models/operations/GetStatisticsResponseBody.md - docs/models/operations/GetStatisticsResponse.md - - docs/models/operations/GetSessionsErrors.md - - docs/models/operations/GetSessionsSessionsResponseBody.md + - docs/models/operations/GetResourcesStatisticsRequest.md + - docs/models/operations/StatisticsResources.md + - docs/models/operations/GetResourcesStatisticsMediaContainer.md + - docs/models/operations/GetResourcesStatisticsResponseBody.md + - docs/models/operations/GetResourcesStatisticsResponse.md + - docs/models/operations/GetBandwidthStatisticsRequest.md + - docs/models/operations/GetBandwidthStatisticsDevice.md + - docs/models/operations/GetBandwidthStatisticsAccount.md + - docs/models/operations/StatisticsBandwidth.md + - docs/models/operations/GetBandwidthStatisticsMediaContainer.md + - docs/models/operations/GetBandwidthStatisticsResponseBody.md + - docs/models/operations/GetBandwidthStatisticsResponse.md - docs/models/operations/GetSessionsStream.md - docs/models/operations/GetSessionsPart.md - docs/models/operations/GetSessionsMedia.md - - docs/models/operations/User.md + - docs/models/operations/GetSessionsUser.md - docs/models/operations/Player.md - docs/models/operations/Session.md - docs/models/operations/GetSessionsMetadata.md - docs/models/operations/GetSessionsMediaContainer.md - docs/models/operations/GetSessionsResponseBody.md - docs/models/operations/GetSessionsResponse.md - - docs/models/operations/GetSessionHistoryErrors.md - - docs/models/operations/GetSessionHistorySessionsResponseBody.md + - docs/models/operations/Filter.md + - docs/models/operations/GetSessionHistoryRequest.md - docs/models/operations/GetSessionHistoryMetadata.md - docs/models/operations/GetSessionHistoryMediaContainer.md - docs/models/operations/GetSessionHistoryResponseBody.md - docs/models/operations/GetSessionHistoryResponse.md - - docs/models/operations/GetTranscodeSessionsErrors.md - - docs/models/operations/GetTranscodeSessionsSessionsResponseBody.md - docs/models/operations/TranscodeSession.md - docs/models/operations/GetTranscodeSessionsMediaContainer.md - docs/models/operations/GetTranscodeSessionsResponseBody.md - docs/models/operations/GetTranscodeSessionsResponse.md - docs/models/operations/StopTranscodeSessionRequest.md - - docs/models/operations/StopTranscodeSessionErrors.md - - docs/models/operations/StopTranscodeSessionResponseBody.md - docs/models/operations/StopTranscodeSessionResponse.md - - docs/models/operations/GetUpdateStatusErrors.md - - docs/models/operations/GetUpdateStatusUpdaterResponseBody.md - docs/models/operations/Release.md - docs/models/operations/GetUpdateStatusMediaContainer.md - docs/models/operations/GetUpdateStatusResponseBody.md - docs/models/operations/GetUpdateStatusResponse.md - docs/models/operations/Download.md - docs/models/operations/CheckForUpdatesRequest.md - - docs/models/operations/CheckForUpdatesErrors.md - - docs/models/operations/CheckForUpdatesResponseBody.md - docs/models/operations/CheckForUpdatesResponse.md - docs/models/operations/Tonight.md - docs/models/operations/Skip.md - docs/models/operations/ApplyUpdatesRequest.md - - docs/models/operations/ApplyUpdatesErrors.md - - docs/models/operations/ApplyUpdatesResponseBody.md - docs/models/operations/ApplyUpdatesResponse.md + - docs/models/operations/PathParamFilter.md + - docs/models/operations/Libtype.md + - docs/models/operations/IncludeCollections.md + - docs/models/operations/IncludeExternalMedia.md + - docs/models/operations/GetWatchlistRequest.md + - docs/models/operations/Image.md + - docs/models/operations/Metadata.md + - docs/models/operations/GetWatchlistResponseBody.md + - docs/models/operations/GetWatchlistResponse.md + - docs/models/errors/Errors.md + - docs/models/errors/GetServerCapabilitiesResponseBody.md + - docs/models/errors/GetServerPreferencesErrors.md + - docs/models/errors/GetServerPreferencesResponseBody.md + - docs/models/errors/GetAvailableClientsErrors.md + - docs/models/errors/GetAvailableClientsResponseBody.md + - docs/models/errors/GetDevicesErrors.md + - docs/models/errors/GetDevicesResponseBody.md + - docs/models/errors/GetServerIdentityErrors.md + - docs/models/errors/GetServerIdentityResponseBody.md + - docs/models/errors/GetMyPlexAccountErrors.md + - docs/models/errors/GetMyPlexAccountResponseBody.md + - docs/models/errors/GetResizedPhotoErrors.md + - docs/models/errors/GetResizedPhotoResponseBody.md + - docs/models/errors/GetServerListErrors.md + - docs/models/errors/GetServerListResponseBody.md + - docs/models/errors/MarkPlayedErrors.md + - docs/models/errors/MarkPlayedResponseBody.md + - docs/models/errors/MarkUnplayedErrors.md + - docs/models/errors/MarkUnplayedResponseBody.md + - docs/models/errors/UpdatePlayProgressErrors.md + - docs/models/errors/UpdatePlayProgressResponseBody.md + - docs/models/errors/GetTimelineErrors.md + - docs/models/errors/GetTimelineResponseBody.md + - docs/models/errors/StartUniversalTranscodeErrors.md + - docs/models/errors/StartUniversalTranscodeResponseBody.md + - docs/models/errors/GetServerActivitiesErrors.md + - docs/models/errors/GetServerActivitiesResponseBody.md + - docs/models/errors/CancelServerActivitiesErrors.md + - docs/models/errors/CancelServerActivitiesResponseBody.md + - docs/models/errors/GetButlerTasksErrors.md + - docs/models/errors/GetButlerTasksResponseBody.md + - docs/models/errors/StartAllTasksErrors.md + - docs/models/errors/StartAllTasksResponseBody.md + - docs/models/errors/StopAllTasksErrors.md + - docs/models/errors/StopAllTasksResponseBody.md + - docs/models/errors/StartTaskErrors.md + - docs/models/errors/StartTaskResponseBody.md + - docs/models/errors/StopTaskErrors.md + - docs/models/errors/StopTaskResponseBody.md + - docs/models/errors/GetHomeDataErrors.md + - docs/models/errors/GetHomeDataResponseBody.md + - docs/models/errors/GetPinErrors.md + - docs/models/errors/GetPinResponseBody.md + - docs/models/errors/GetTokenErrors.md + - docs/models/errors/GetTokenResponseBody.md + - docs/models/errors/GetGlobalHubsErrors.md + - docs/models/errors/GetGlobalHubsResponseBody.md + - docs/models/errors/GetLibraryHubsErrors.md + - docs/models/errors/GetLibraryHubsResponseBody.md + - docs/models/errors/PerformSearchErrors.md + - docs/models/errors/PerformSearchResponseBody.md + - docs/models/errors/PerformVoiceSearchErrors.md + - docs/models/errors/PerformVoiceSearchResponseBody.md + - docs/models/errors/GetSearchResultsErrors.md + - docs/models/errors/GetSearchResultsResponseBody.md + - docs/models/errors/GetFileHashErrors.md + - docs/models/errors/GetFileHashResponseBody.md + - docs/models/errors/GetRecentlyAddedErrors.md + - docs/models/errors/GetRecentlyAddedResponseBody.md + - docs/models/errors/GetLibrariesErrors.md + - docs/models/errors/GetLibrariesResponseBody.md + - docs/models/errors/GetLibraryErrors.md + - docs/models/errors/GetLibraryResponseBody.md + - docs/models/errors/DeleteLibraryErrors.md + - docs/models/errors/DeleteLibraryResponseBody.md + - docs/models/errors/GetLibraryItemsErrors.md + - docs/models/errors/GetLibraryItemsResponseBody.md + - docs/models/errors/RefreshLibraryErrors.md + - docs/models/errors/RefreshLibraryResponseBody.md + - docs/models/errors/SearchLibraryErrors.md + - docs/models/errors/SearchLibraryResponseBody.md + - docs/models/errors/GetMetadataErrors.md + - docs/models/errors/GetMetadataResponseBody.md + - docs/models/errors/GetMetadataChildrenErrors.md + - docs/models/errors/GetMetadataChildrenResponseBody.md + - docs/models/errors/GetOnDeckErrors.md + - docs/models/errors/GetOnDeckResponseBody.md + - docs/models/errors/LogLineErrors.md + - docs/models/errors/LogLineResponseBody.md + - docs/models/errors/LogMultiLineErrors.md + - docs/models/errors/LogMultiLineResponseBody.md + - docs/models/errors/EnablePaperTrailErrors.md + - docs/models/errors/EnablePaperTrailResponseBody.md + - docs/models/errors/CreatePlaylistErrors.md + - docs/models/errors/CreatePlaylistResponseBody.md + - docs/models/errors/GetPlaylistsErrors.md + - docs/models/errors/GetPlaylistsResponseBody.md + - docs/models/errors/GetPlaylistErrors.md + - docs/models/errors/GetPlaylistResponseBody.md + - docs/models/errors/DeletePlaylistErrors.md + - docs/models/errors/DeletePlaylistResponseBody.md + - docs/models/errors/UpdatePlaylistErrors.md + - docs/models/errors/UpdatePlaylistResponseBody.md + - docs/models/errors/GetPlaylistContentsErrors.md + - docs/models/errors/GetPlaylistContentsResponseBody.md + - docs/models/errors/ClearPlaylistContentsErrors.md + - docs/models/errors/ClearPlaylistContentsResponseBody.md + - docs/models/errors/AddPlaylistContentsErrors.md + - docs/models/errors/AddPlaylistContentsResponseBody.md + - docs/models/errors/UploadPlaylistErrors.md + - docs/models/errors/UploadPlaylistResponseBody.md + - docs/models/errors/GetTransientTokenErrors.md + - docs/models/errors/GetTransientTokenResponseBody.md + - docs/models/errors/GetSourceConnectionInformationErrors.md + - docs/models/errors/GetSourceConnectionInformationResponseBody.md + - docs/models/errors/GetStatisticsErrors.md + - docs/models/errors/GetStatisticsResponseBody.md + - docs/models/errors/GetResourcesStatisticsErrors.md + - docs/models/errors/GetResourcesStatisticsResponseBody.md + - docs/models/errors/GetBandwidthStatisticsErrors.md + - docs/models/errors/GetBandwidthStatisticsResponseBody.md + - docs/models/errors/GetSessionsErrors.md + - docs/models/errors/GetSessionsResponseBody.md + - docs/models/errors/GetSessionHistoryErrors.md + - docs/models/errors/GetSessionHistoryResponseBody.md + - docs/models/errors/GetTranscodeSessionsErrors.md + - docs/models/errors/GetTranscodeSessionsResponseBody.md + - docs/models/errors/StopTranscodeSessionErrors.md + - docs/models/errors/StopTranscodeSessionResponseBody.md + - docs/models/errors/GetUpdateStatusErrors.md + - docs/models/errors/GetUpdateStatusResponseBody.md + - docs/models/errors/CheckForUpdatesErrors.md + - docs/models/errors/CheckForUpdatesResponseBody.md + - docs/models/errors/ApplyUpdatesErrors.md + - docs/models/errors/ApplyUpdatesResponseBody.md + - docs/models/errors/GetWatchlistErrors.md + - docs/models/errors/GetWatchlistResponseBody.md - docs/models/shared/Security.md - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 3b036765..29d8c7e4 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,9 +12,11 @@ generation: auth: oAuth2ClientCredentialsEnabled: true java: - version: 0.0.1 + version: 0.1.1 additionalDependencies: [] + additionalPlugins: [] artifactID: plexapi + clientServerStatusCodesAsErrors: true companyEmail: lukeslakemail@gmail.com companyName: Personal companyURL: lukehagar.com @@ -30,6 +32,10 @@ java: shared: models/shared webhooks: models/webhooks inputModelSuffix: input + license: + name: The MIT License (MIT) + shortName: MIT + url: https://mit-license.org/ maxMethodParams: 4 ossrhURL: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ outputModelSuffix: output diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock new file mode 100644 index 00000000..6e474130 --- /dev/null +++ b/.speakeasy/workflow.lock @@ -0,0 +1,28 @@ +speakeasyVersion: 1.321.0 +sources: + my-source: + sourceNamespace: my-source + sourceRevisionDigest: sha256:7bed80d5d81c0501209a4de7a65ad0bd438a89f9e8f6eba59701704e3fb11ead + sourceBlobDigest: sha256:ab8481086bfdae5fd1aa42a674434b35061177c23040cf48c9247708594ce134 + tags: + - latest +targets: + plexjava: + source: my-source + sourceNamespace: my-source + sourceRevisionDigest: sha256:7bed80d5d81c0501209a4de7a65ad0bd438a89f9e8f6eba59701704e3fb11ead + sourceBlobDigest: sha256:ab8481086bfdae5fd1aa42a674434b35061177c23040cf48c9247708594ce134 + outLocation: /home/luke/github/plexjava +workflow: + workflowVersion: 1.0.0 + speakeasyVersion: latest + sources: + my-source: + inputs: + - location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml + registry: + location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source + targets: + plexjava: + target: java + source: my-source diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index bb9bbc7d..805d77d4 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -1,8 +1,11 @@ workflowVersion: 1.0.0 +speakeasyVersion: latest sources: my-source: inputs: - location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml + registry: + location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source targets: plexjava: target: java diff --git a/README.md b/README.md index a9132ebc..2f160111 100644 --- a/README.md +++ b/README.md @@ -140,46 +140,56 @@ License: MIT. See license in LICENSE. Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Exception type. -| Error Object | Status Code | Content Type | -| ---------------------- | ---------------------- | ---------------------- | -| models/errors/SDKError | 4xx-5xx | */* | +| Error Object | Status Code | Content Type | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| models/errors/GetServerCapabilitiesResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | ### Example ```java package hello.world; +import java.math.BigDecimal; import java.math.BigDecimal; import java.math.BigInteger; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Optional; -import lukehagar.plexapi.plexapi.Plex-API; +import lukehagar.plexapi.plexapi.PlexAPI; import lukehagar.plexapi.plexapi.models.operations.*; -import lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse; import lukehagar.plexapi.plexapi.models.shared.*; import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; import static java.util.Map.entry; public class Application { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { try { PlexAPI sdk = PlexAPI.builder() .accessToken("") + .xPlexClientIdentifier("Postman") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.twoHundredApplicationJsonObject().isPresent()) { + if (res.object().isPresent()) { // handle response } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody e) { + // handle exception + throw e; } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { // handle exception + throw e; } catch (Exception e) { // handle exception + throw e; } + } } ``` @@ -201,38 +211,47 @@ You can override the default server globally by passing a server index to the `s ```java package hello.world; +import java.math.BigDecimal; import java.math.BigDecimal; import java.math.BigInteger; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Optional; -import lukehagar.plexapi.plexapi.Plex-API; +import lukehagar.plexapi.plexapi.PlexAPI; import lukehagar.plexapi.plexapi.models.operations.*; -import lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse; import lukehagar.plexapi.plexapi.models.shared.*; import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; import static java.util.Map.entry; public class Application { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { try { PlexAPI sdk = PlexAPI.builder() .serverIndex(0) .accessToken("") + .xPlexClientIdentifier("Postman") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.twoHundredApplicationJsonObject().isPresent()) { + if (res.object().isPresent()) { // handle response } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody e) { + // handle exception + throw e; } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { // handle exception + throw e; } catch (Exception e) { // handle exception + throw e; } + } } ``` @@ -250,38 +269,47 @@ The default server can also be overridden globally by passing a URL to the `serv ```java package hello.world; +import java.math.BigDecimal; import java.math.BigDecimal; import java.math.BigInteger; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Optional; -import lukehagar.plexapi.plexapi.Plex-API; +import lukehagar.plexapi.plexapi.PlexAPI; import lukehagar.plexapi.plexapi.models.operations.*; -import lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse; import lukehagar.plexapi.plexapi.models.shared.*; import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; import static java.util.Map.entry; public class Application { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { try { PlexAPI sdk = PlexAPI.builder() .serverURL("{protocol}://{ip}:{port}") .accessToken("") + .xPlexClientIdentifier("Postman") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.twoHundredApplicationJsonObject().isPresent()) { + if (res.object().isPresent()) { // handle response } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody e) { + // handle exception + throw e; } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { // handle exception + throw e; } catch (Exception e) { // handle exception + throw e; } + } } ``` @@ -292,39 +320,48 @@ The server URL can also be overridden on a per-operation basis, provided a serve ```java package hello.world; +import java.math.BigDecimal; import java.math.BigDecimal; import java.math.BigInteger; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Optional; -import lukehagar.plexapi.plexapi.Plex-API; +import lukehagar.plexapi.plexapi.PlexAPI; import lukehagar.plexapi.plexapi.models.operations.*; -import lukehagar.plexapi.plexapi.models.operations.GetPinRequest; -import lukehagar.plexapi.plexapi.models.operations.GetPinResponse; import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; import static java.util.Map.entry; public class Application { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { try { PlexAPI sdk = PlexAPI.builder() + .xPlexClientIdentifier("Postman") .build(); GetPinResponse res = sdk.plex().getPin() .serverURL("https://plex.tv/api/v2") .strong(false) - .xPlexClientIdentifier("") + .xPlexClientIdentifier("Postman") + .xPlexProduct("Postman") .call(); - if (res.twoHundredApplicationJsonObject().isPresent()) { + if (res.object().isPresent()) { // handle response } + } catch (lukehagar.plexapi.plexapi.models.errors.GetPinResponseBody e) { + // handle exception + throw e; } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { // handle exception + throw e; } catch (Exception e) { // handle exception + throw e; } + } } ``` @@ -345,42 +382,122 @@ To authenticate with the API the `accessToken` parameter must be set when initia ```java package hello.world; +import java.math.BigDecimal; import java.math.BigDecimal; import java.math.BigInteger; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Optional; -import lukehagar.plexapi.plexapi.Plex-API; +import lukehagar.plexapi.plexapi.PlexAPI; import lukehagar.plexapi.plexapi.models.operations.*; -import lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse; import lukehagar.plexapi.plexapi.models.shared.*; import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; import static java.util.Map.entry; public class Application { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { try { PlexAPI sdk = PlexAPI.builder() .accessToken("") + .xPlexClientIdentifier("Postman") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.twoHundredApplicationJsonObject().isPresent()) { + if (res.object().isPresent()) { // handle response } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody e) { + // handle exception + throw e; } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { // handle exception + throw e; } catch (Exception e) { // handle exception + throw e; } + } } ``` + +## Global Parameters + +A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed. + +For example, you can set `X-Plex-Client-Identifier` to `"Postman"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. + + +### Available Globals + +The following global parameter is available. + +| Name | Type | Required | Description | +| ---- | ---- |:--------:| ----------- | +| xPlexClientIdentifier | String | | The unique identifier for the client application +This is used to track the client application and its usage +(UUID, serial number, or other number unique per device) + | + + +### Example + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .xPlexClientIdentifier("Postman") + .build(); + + GetPinResponse res = sdk.plex().getPin() + .strong(false) + .xPlexClientIdentifier("Postman") + .xPlexProduct("Postman") + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetPinResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + diff --git a/USAGE.md b/USAGE.md index aaf938c7..26f5ab11 100644 --- a/USAGE.md +++ b/USAGE.md @@ -2,37 +2,46 @@ ```java package hello.world; +import java.math.BigDecimal; import java.math.BigDecimal; import java.math.BigInteger; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Optional; -import lukehagar.plexapi.plexapi.Plex-API; +import lukehagar.plexapi.plexapi.PlexAPI; import lukehagar.plexapi.plexapi.models.operations.*; -import lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse; import lukehagar.plexapi.plexapi.models.shared.*; import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; import static java.util.Map.entry; public class Application { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { try { PlexAPI sdk = PlexAPI.builder() .accessToken("") + .xPlexClientIdentifier("Postman") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.twoHundredApplicationJsonObject().isPresent()) { + if (res.object().isPresent()) { // handle response } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody e) { + // handle exception + throw e; } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { // handle exception + throw e; } catch (Exception e) { // handle exception + throw e; } + } } ``` diff --git a/build-extras.gradle b/build-extras.gradle new file mode 100644 index 00000000..e104d4f6 --- /dev/null +++ b/build-extras.gradle @@ -0,0 +1,4 @@ +// This file +// * is referred to in an `apply from` command in `build.gradle` +// * can be used to customise `build.gradle` +// * is generated once and not overwritten in SDK generation updates diff --git a/build.gradle b/build.gradle index 3e140323..c1b13ce2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,20 @@ +//////////////////////////////////////////////////////////////////////////////////////////// +// This file is generated by Speakeasy and any edits will be lost in generation updates. +// +// If you wish to customize this file then place those customizations in `build-extras.gradle` which +// is not touched by generation updates. +// +// Additions to the plugins block can be made by setting the `additionalPlugins` property (an array +// of string where each string value is an additional line in the block) in gen.yaml. +//////////////////////////////////////////////////////////////////////////////////////////// plugins { // Apply the java-library plugin for API and implementation separation. id 'java-library' } compileJava.options.encoding = "UTF-8" +compileJava.options.compilerArgs += '-Xlint:unchecked' compileTestJava.options.encoding = "UTF-8" repositories { @@ -12,20 +22,28 @@ repositories { mavenCentral() } +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + withSourcesJar() + withJavadocJar() +} + tasks.withType(Javadoc) { failOnError false options.addStringOption('Xdoclint:none', '-quiet') } dependencies { - implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.2' - implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.2' - implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.16.2' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.0' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.0' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation 'org.apache.httpcomponents:httpclient:4.5.14' implementation 'org.apache.httpcomponents:httpmime:4.5.14' - implementation 'com.jayway.jsonpath:json-path:2.9.0' implementation 'commons-io:commons-io:2.15.1' } + +apply from: 'build-extras.gradle' diff --git a/docs/models/operations/AddPlaylistContentsErrors.md b/docs/models/errors/AddPlaylistContentsErrors.md similarity index 100% rename from docs/models/operations/AddPlaylistContentsErrors.md rename to docs/models/errors/AddPlaylistContentsErrors.md diff --git a/docs/models/errors/AddPlaylistContentsResponseBody.md b/docs/models/errors/AddPlaylistContentsResponseBody.md new file mode 100644 index 00000000..80189d41 --- /dev/null +++ b/docs/models/errors/AddPlaylistContentsResponseBody.md @@ -0,0 +1,11 @@ +# AddPlaylistContentsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/ApplyUpdatesErrors.md b/docs/models/errors/ApplyUpdatesErrors.md similarity index 100% rename from docs/models/operations/ApplyUpdatesErrors.md rename to docs/models/errors/ApplyUpdatesErrors.md diff --git a/docs/models/errors/ApplyUpdatesResponseBody.md b/docs/models/errors/ApplyUpdatesResponseBody.md new file mode 100644 index 00000000..d54fb4ae --- /dev/null +++ b/docs/models/errors/ApplyUpdatesResponseBody.md @@ -0,0 +1,11 @@ +# ApplyUpdatesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/CancelServerActivitiesErrors.md b/docs/models/errors/CancelServerActivitiesErrors.md similarity index 100% rename from docs/models/operations/CancelServerActivitiesErrors.md rename to docs/models/errors/CancelServerActivitiesErrors.md diff --git a/docs/models/operations/PerformVoiceSearchResponseBody.md b/docs/models/errors/CancelServerActivitiesResponseBody.md similarity index 69% rename from docs/models/operations/PerformVoiceSearchResponseBody.md rename to docs/models/errors/CancelServerActivitiesResponseBody.md index b7079bfd..943bcd26 100644 --- a/docs/models/operations/PerformVoiceSearchResponseBody.md +++ b/docs/models/errors/CancelServerActivitiesResponseBody.md @@ -1,4 +1,4 @@ -# PerformVoiceSearchResponseBody +# CancelServerActivitiesResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -7,4 +7,5 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchErrors](../../models/operations/PerformVoiceSearchErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/CheckForUpdatesErrors.md b/docs/models/errors/CheckForUpdatesErrors.md similarity index 100% rename from docs/models/operations/CheckForUpdatesErrors.md rename to docs/models/errors/CheckForUpdatesErrors.md diff --git a/docs/models/errors/CheckForUpdatesResponseBody.md b/docs/models/errors/CheckForUpdatesResponseBody.md new file mode 100644 index 00000000..c8c37bdf --- /dev/null +++ b/docs/models/errors/CheckForUpdatesResponseBody.md @@ -0,0 +1,11 @@ +# CheckForUpdatesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/ClearPlaylistContentsErrors.md b/docs/models/errors/ClearPlaylistContentsErrors.md similarity index 100% rename from docs/models/operations/ClearPlaylistContentsErrors.md rename to docs/models/errors/ClearPlaylistContentsErrors.md diff --git a/docs/models/operations/GetServerIdentityServerResponseBody.md b/docs/models/errors/ClearPlaylistContentsResponseBody.md similarity index 69% rename from docs/models/operations/GetServerIdentityServerResponseBody.md rename to docs/models/errors/ClearPlaylistContentsResponseBody.md index 3df7ea44..ead31202 100644 --- a/docs/models/operations/GetServerIdentityServerResponseBody.md +++ b/docs/models/errors/ClearPlaylistContentsResponseBody.md @@ -1,4 +1,4 @@ -# GetServerIdentityServerResponseBody +# ClearPlaylistContentsResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -7,4 +7,5 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetServerIdentityErrors](../../models/operations/GetServerIdentityErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/CreatePlaylistErrors.md b/docs/models/errors/CreatePlaylistErrors.md similarity index 100% rename from docs/models/operations/CreatePlaylistErrors.md rename to docs/models/errors/CreatePlaylistErrors.md diff --git a/docs/models/errors/CreatePlaylistResponseBody.md b/docs/models/errors/CreatePlaylistResponseBody.md new file mode 100644 index 00000000..444279d9 --- /dev/null +++ b/docs/models/errors/CreatePlaylistResponseBody.md @@ -0,0 +1,11 @@ +# CreatePlaylistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/DeleteLibraryErrors.md b/docs/models/errors/DeleteLibraryErrors.md similarity index 100% rename from docs/models/operations/DeleteLibraryErrors.md rename to docs/models/errors/DeleteLibraryErrors.md diff --git a/docs/models/errors/DeleteLibraryResponseBody.md b/docs/models/errors/DeleteLibraryResponseBody.md new file mode 100644 index 00000000..ea3431ce --- /dev/null +++ b/docs/models/errors/DeleteLibraryResponseBody.md @@ -0,0 +1,11 @@ +# DeleteLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/DeletePlaylistErrors.md b/docs/models/errors/DeletePlaylistErrors.md similarity index 100% rename from docs/models/operations/DeletePlaylistErrors.md rename to docs/models/errors/DeletePlaylistErrors.md diff --git a/docs/models/errors/DeletePlaylistResponseBody.md b/docs/models/errors/DeletePlaylistResponseBody.md new file mode 100644 index 00000000..7770d0f6 --- /dev/null +++ b/docs/models/errors/DeletePlaylistResponseBody.md @@ -0,0 +1,11 @@ +# DeletePlaylistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/EnablePaperTrailErrors.md b/docs/models/errors/EnablePaperTrailErrors.md similarity index 100% rename from docs/models/operations/EnablePaperTrailErrors.md rename to docs/models/errors/EnablePaperTrailErrors.md diff --git a/docs/models/operations/EnablePaperTrailResponseBody.md b/docs/models/errors/EnablePaperTrailResponseBody.md similarity index 70% rename from docs/models/operations/EnablePaperTrailResponseBody.md rename to docs/models/errors/EnablePaperTrailResponseBody.md index 99226965..4aa29ce0 100644 --- a/docs/models/operations/EnablePaperTrailResponseBody.md +++ b/docs/models/errors/EnablePaperTrailResponseBody.md @@ -7,4 +7,5 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailErrors](../../models/operations/EnablePaperTrailErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/Errors.md b/docs/models/errors/Errors.md similarity index 100% rename from docs/models/operations/Errors.md rename to docs/models/errors/Errors.md diff --git a/docs/models/operations/GetAvailableClientsErrors.md b/docs/models/errors/GetAvailableClientsErrors.md similarity index 100% rename from docs/models/operations/GetAvailableClientsErrors.md rename to docs/models/errors/GetAvailableClientsErrors.md diff --git a/docs/models/errors/GetAvailableClientsResponseBody.md b/docs/models/errors/GetAvailableClientsResponseBody.md new file mode 100644 index 00000000..b6bed79c --- /dev/null +++ b/docs/models/errors/GetAvailableClientsResponseBody.md @@ -0,0 +1,11 @@ +# GetAvailableClientsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/GetBandwidthStatisticsErrors.md b/docs/models/errors/GetBandwidthStatisticsErrors.md new file mode 100644 index 00000000..141e81d7 --- /dev/null +++ b/docs/models/errors/GetBandwidthStatisticsErrors.md @@ -0,0 +1,10 @@ +# GetBandwidthStatisticsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *Optional* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *Optional* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *Optional* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/operations/UpdatePlayProgressResponseBody.md b/docs/models/errors/GetBandwidthStatisticsResponseBody.md similarity index 69% rename from docs/models/operations/UpdatePlayProgressResponseBody.md rename to docs/models/errors/GetBandwidthStatisticsResponseBody.md index 9404b433..61ce8fce 100644 --- a/docs/models/operations/UpdatePlayProgressResponseBody.md +++ b/docs/models/errors/GetBandwidthStatisticsResponseBody.md @@ -1,4 +1,4 @@ -# UpdatePlayProgressResponseBody +# GetBandwidthStatisticsResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -7,4 +7,5 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressErrors](../../models/operations/UpdatePlayProgressErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetButlerTasksErrors.md b/docs/models/errors/GetButlerTasksErrors.md similarity index 100% rename from docs/models/operations/GetButlerTasksErrors.md rename to docs/models/errors/GetButlerTasksErrors.md diff --git a/docs/models/errors/GetButlerTasksResponseBody.md b/docs/models/errors/GetButlerTasksResponseBody.md new file mode 100644 index 00000000..409d7e99 --- /dev/null +++ b/docs/models/errors/GetButlerTasksResponseBody.md @@ -0,0 +1,11 @@ +# GetButlerTasksResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetDevicesErrors.md b/docs/models/errors/GetDevicesErrors.md similarity index 100% rename from docs/models/operations/GetDevicesErrors.md rename to docs/models/errors/GetDevicesErrors.md diff --git a/docs/models/errors/GetDevicesResponseBody.md b/docs/models/errors/GetDevicesResponseBody.md new file mode 100644 index 00000000..2d3a2c92 --- /dev/null +++ b/docs/models/errors/GetDevicesResponseBody.md @@ -0,0 +1,11 @@ +# GetDevicesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetFileHashErrors.md b/docs/models/errors/GetFileHashErrors.md similarity index 100% rename from docs/models/operations/GetFileHashErrors.md rename to docs/models/errors/GetFileHashErrors.md diff --git a/docs/models/errors/GetFileHashResponseBody.md b/docs/models/errors/GetFileHashResponseBody.md new file mode 100644 index 00000000..6c1d33cd --- /dev/null +++ b/docs/models/errors/GetFileHashResponseBody.md @@ -0,0 +1,11 @@ +# GetFileHashResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetGlobalHubsErrors.md b/docs/models/errors/GetGlobalHubsErrors.md similarity index 100% rename from docs/models/operations/GetGlobalHubsErrors.md rename to docs/models/errors/GetGlobalHubsErrors.md diff --git a/docs/models/errors/GetGlobalHubsResponseBody.md b/docs/models/errors/GetGlobalHubsResponseBody.md new file mode 100644 index 00000000..1aee6f94 --- /dev/null +++ b/docs/models/errors/GetGlobalHubsResponseBody.md @@ -0,0 +1,11 @@ +# GetGlobalHubsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/GetHomeDataErrors.md b/docs/models/errors/GetHomeDataErrors.md new file mode 100644 index 00000000..cb4b7f7a --- /dev/null +++ b/docs/models/errors/GetHomeDataErrors.md @@ -0,0 +1,10 @@ +# GetHomeDataErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *Optional* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *Optional* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *Optional* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/errors/GetHomeDataResponseBody.md b/docs/models/errors/GetHomeDataResponseBody.md new file mode 100644 index 00000000..1115e7af --- /dev/null +++ b/docs/models/errors/GetHomeDataResponseBody.md @@ -0,0 +1,11 @@ +# GetHomeDataResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetLibrariesErrors.md b/docs/models/errors/GetLibrariesErrors.md similarity index 100% rename from docs/models/operations/GetLibrariesErrors.md rename to docs/models/errors/GetLibrariesErrors.md diff --git a/docs/models/errors/GetLibrariesResponseBody.md b/docs/models/errors/GetLibrariesResponseBody.md new file mode 100644 index 00000000..87168f57 --- /dev/null +++ b/docs/models/errors/GetLibrariesResponseBody.md @@ -0,0 +1,11 @@ +# GetLibrariesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.GetLibrariesErrors](../../models/errors/GetLibrariesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.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/GetLibraryErrors.md b/docs/models/errors/GetLibraryErrors.md similarity index 100% rename from docs/models/operations/GetLibraryErrors.md rename to docs/models/errors/GetLibraryErrors.md diff --git a/docs/models/operations/GetLibraryHubsErrors.md b/docs/models/errors/GetLibraryHubsErrors.md similarity index 100% rename from docs/models/operations/GetLibraryHubsErrors.md rename to docs/models/errors/GetLibraryHubsErrors.md diff --git a/docs/models/errors/GetLibraryHubsResponseBody.md b/docs/models/errors/GetLibraryHubsResponseBody.md new file mode 100644 index 00000000..d72d4476 --- /dev/null +++ b/docs/models/errors/GetLibraryHubsResponseBody.md @@ -0,0 +1,11 @@ +# GetLibraryHubsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/GetLibraryItemsErrors.md b/docs/models/errors/GetLibraryItemsErrors.md new file mode 100644 index 00000000..5c814a7e --- /dev/null +++ b/docs/models/errors/GetLibraryItemsErrors.md @@ -0,0 +1,10 @@ +# GetLibraryItemsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *Optional* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *Optional* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *Optional* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/errors/GetLibraryItemsResponseBody.md b/docs/models/errors/GetLibraryItemsResponseBody.md new file mode 100644 index 00000000..5a2b744f --- /dev/null +++ b/docs/models/errors/GetLibraryItemsResponseBody.md @@ -0,0 +1,11 @@ +# GetLibraryItemsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/GetLibraryResponseBody.md b/docs/models/errors/GetLibraryResponseBody.md new file mode 100644 index 00000000..355a29a1 --- /dev/null +++ b/docs/models/errors/GetLibraryResponseBody.md @@ -0,0 +1,11 @@ +# GetLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.GetLibraryErrors](../../models/errors/GetLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.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/GetMetadataChildrenErrors.md b/docs/models/errors/GetMetadataChildrenErrors.md similarity index 100% rename from docs/models/operations/GetMetadataChildrenErrors.md rename to docs/models/errors/GetMetadataChildrenErrors.md diff --git a/docs/models/errors/GetMetadataChildrenResponseBody.md b/docs/models/errors/GetMetadataChildrenResponseBody.md new file mode 100644 index 00000000..1f25880f --- /dev/null +++ b/docs/models/errors/GetMetadataChildrenResponseBody.md @@ -0,0 +1,11 @@ +# GetMetadataChildrenResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetMetadataErrors.md b/docs/models/errors/GetMetadataErrors.md similarity index 100% rename from docs/models/operations/GetMetadataErrors.md rename to docs/models/errors/GetMetadataErrors.md diff --git a/docs/models/errors/GetMetadataResponseBody.md b/docs/models/errors/GetMetadataResponseBody.md new file mode 100644 index 00000000..06c4cd96 --- /dev/null +++ b/docs/models/errors/GetMetadataResponseBody.md @@ -0,0 +1,11 @@ +# GetMetadataResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.GetMetadataErrors](../../models/errors/GetMetadataErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.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/GetMyPlexAccountErrors.md b/docs/models/errors/GetMyPlexAccountErrors.md similarity index 100% rename from docs/models/operations/GetMyPlexAccountErrors.md rename to docs/models/errors/GetMyPlexAccountErrors.md diff --git a/docs/models/errors/GetMyPlexAccountResponseBody.md b/docs/models/errors/GetMyPlexAccountResponseBody.md new file mode 100644 index 00000000..49115804 --- /dev/null +++ b/docs/models/errors/GetMyPlexAccountResponseBody.md @@ -0,0 +1,11 @@ +# GetMyPlexAccountResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetOnDeckErrors.md b/docs/models/errors/GetOnDeckErrors.md similarity index 100% rename from docs/models/operations/GetOnDeckErrors.md rename to docs/models/errors/GetOnDeckErrors.md diff --git a/docs/models/operations/GetSearchResultsSearchResponseBody.md b/docs/models/errors/GetOnDeckResponseBody.md similarity index 69% rename from docs/models/operations/GetSearchResultsSearchResponseBody.md rename to docs/models/errors/GetOnDeckResponseBody.md index 021bd7ae..e5c1ad89 100644 --- a/docs/models/operations/GetSearchResultsSearchResponseBody.md +++ b/docs/models/errors/GetOnDeckResponseBody.md @@ -1,4 +1,4 @@ -# GetSearchResultsSearchResponseBody +# GetOnDeckResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -7,4 +7,5 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetSearchResultsErrors](../../models/operations/GetSearchResultsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.GetOnDeckErrors](../../models/errors/GetOnDeckErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.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/GetPinErrors.md b/docs/models/errors/GetPinErrors.md similarity index 100% rename from docs/models/operations/GetPinErrors.md rename to docs/models/errors/GetPinErrors.md diff --git a/docs/models/errors/GetPinResponseBody.md b/docs/models/errors/GetPinResponseBody.md new file mode 100644 index 00000000..3489784b --- /dev/null +++ b/docs/models/errors/GetPinResponseBody.md @@ -0,0 +1,11 @@ +# GetPinResponseBody + +X-Plex-Client-Identifier is missing + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetPlaylistContentsErrors.md b/docs/models/errors/GetPlaylistContentsErrors.md similarity index 100% rename from docs/models/operations/GetPlaylistContentsErrors.md rename to docs/models/errors/GetPlaylistContentsErrors.md diff --git a/docs/models/errors/GetPlaylistContentsResponseBody.md b/docs/models/errors/GetPlaylistContentsResponseBody.md new file mode 100644 index 00000000..6af4e429 --- /dev/null +++ b/docs/models/errors/GetPlaylistContentsResponseBody.md @@ -0,0 +1,11 @@ +# GetPlaylistContentsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetPlaylistErrors.md b/docs/models/errors/GetPlaylistErrors.md similarity index 100% rename from docs/models/operations/GetPlaylistErrors.md rename to docs/models/errors/GetPlaylistErrors.md diff --git a/docs/models/errors/GetPlaylistResponseBody.md b/docs/models/errors/GetPlaylistResponseBody.md new file mode 100644 index 00000000..ef8fbc6d --- /dev/null +++ b/docs/models/errors/GetPlaylistResponseBody.md @@ -0,0 +1,11 @@ +# GetPlaylistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetPlaylistsErrors.md b/docs/models/errors/GetPlaylistsErrors.md similarity index 100% rename from docs/models/operations/GetPlaylistsErrors.md rename to docs/models/errors/GetPlaylistsErrors.md diff --git a/docs/models/errors/GetPlaylistsResponseBody.md b/docs/models/errors/GetPlaylistsResponseBody.md new file mode 100644 index 00000000..03a59fc5 --- /dev/null +++ b/docs/models/errors/GetPlaylistsResponseBody.md @@ -0,0 +1,11 @@ +# GetPlaylistsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetRecentlyAddedErrors.md b/docs/models/errors/GetRecentlyAddedErrors.md similarity index 100% rename from docs/models/operations/GetRecentlyAddedErrors.md rename to docs/models/errors/GetRecentlyAddedErrors.md diff --git a/docs/models/errors/GetRecentlyAddedResponseBody.md b/docs/models/errors/GetRecentlyAddedResponseBody.md new file mode 100644 index 00000000..086a3c2b --- /dev/null +++ b/docs/models/errors/GetRecentlyAddedResponseBody.md @@ -0,0 +1,11 @@ +# GetRecentlyAddedResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.GetRecentlyAddedErrors](../../models/errors/GetRecentlyAddedErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.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/GetResizedPhotoErrors.md b/docs/models/errors/GetResizedPhotoErrors.md similarity index 100% rename from docs/models/operations/GetResizedPhotoErrors.md rename to docs/models/errors/GetResizedPhotoErrors.md diff --git a/docs/models/errors/GetResizedPhotoResponseBody.md b/docs/models/errors/GetResizedPhotoResponseBody.md new file mode 100644 index 00000000..6098c70c --- /dev/null +++ b/docs/models/errors/GetResizedPhotoResponseBody.md @@ -0,0 +1,11 @@ +# GetResizedPhotoResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/GetResourcesStatisticsErrors.md b/docs/models/errors/GetResourcesStatisticsErrors.md new file mode 100644 index 00000000..0bbb259f --- /dev/null +++ b/docs/models/errors/GetResourcesStatisticsErrors.md @@ -0,0 +1,10 @@ +# GetResourcesStatisticsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *Optional* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *Optional* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *Optional* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/errors/GetResourcesStatisticsResponseBody.md b/docs/models/errors/GetResourcesStatisticsResponseBody.md new file mode 100644 index 00000000..3334d2f9 --- /dev/null +++ b/docs/models/errors/GetResourcesStatisticsResponseBody.md @@ -0,0 +1,11 @@ +# GetResourcesStatisticsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetSearchResultsErrors.md b/docs/models/errors/GetSearchResultsErrors.md similarity index 100% rename from docs/models/operations/GetSearchResultsErrors.md rename to docs/models/errors/GetSearchResultsErrors.md diff --git a/docs/models/errors/GetSearchResultsResponseBody.md b/docs/models/errors/GetSearchResultsResponseBody.md new file mode 100644 index 00000000..9465dd10 --- /dev/null +++ b/docs/models/errors/GetSearchResultsResponseBody.md @@ -0,0 +1,11 @@ +# GetSearchResultsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetServerActivitiesErrors.md b/docs/models/errors/GetServerActivitiesErrors.md similarity index 100% rename from docs/models/operations/GetServerActivitiesErrors.md rename to docs/models/errors/GetServerActivitiesErrors.md diff --git a/docs/models/errors/GetServerActivitiesResponseBody.md b/docs/models/errors/GetServerActivitiesResponseBody.md new file mode 100644 index 00000000..8903b02c --- /dev/null +++ b/docs/models/errors/GetServerActivitiesResponseBody.md @@ -0,0 +1,11 @@ +# GetServerActivitiesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/GetServerCapabilitiesResponseBody.md b/docs/models/errors/GetServerCapabilitiesResponseBody.md new file mode 100644 index 00000000..f37f6af1 --- /dev/null +++ b/docs/models/errors/GetServerCapabilitiesResponseBody.md @@ -0,0 +1,11 @@ +# GetServerCapabilitiesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetServerIdentityErrors.md b/docs/models/errors/GetServerIdentityErrors.md similarity index 100% rename from docs/models/operations/GetServerIdentityErrors.md rename to docs/models/errors/GetServerIdentityErrors.md diff --git a/docs/models/errors/GetServerIdentityResponseBody.md b/docs/models/errors/GetServerIdentityResponseBody.md new file mode 100644 index 00000000..606a74ad --- /dev/null +++ b/docs/models/errors/GetServerIdentityResponseBody.md @@ -0,0 +1,11 @@ +# GetServerIdentityResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.GetServerIdentityErrors](../../models/errors/GetServerIdentityErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.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/GetServerListErrors.md b/docs/models/errors/GetServerListErrors.md similarity index 100% rename from docs/models/operations/GetServerListErrors.md rename to docs/models/errors/GetServerListErrors.md diff --git a/docs/models/errors/GetServerListResponseBody.md b/docs/models/errors/GetServerListResponseBody.md new file mode 100644 index 00000000..2ef710e8 --- /dev/null +++ b/docs/models/errors/GetServerListResponseBody.md @@ -0,0 +1,11 @@ +# GetServerListResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetServerPreferencesErrors.md b/docs/models/errors/GetServerPreferencesErrors.md similarity index 100% rename from docs/models/operations/GetServerPreferencesErrors.md rename to docs/models/errors/GetServerPreferencesErrors.md diff --git a/docs/models/errors/GetServerPreferencesResponseBody.md b/docs/models/errors/GetServerPreferencesResponseBody.md new file mode 100644 index 00000000..da327cf0 --- /dev/null +++ b/docs/models/errors/GetServerPreferencesResponseBody.md @@ -0,0 +1,11 @@ +# GetServerPreferencesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetSessionHistoryErrors.md b/docs/models/errors/GetSessionHistoryErrors.md similarity index 100% rename from docs/models/operations/GetSessionHistoryErrors.md rename to docs/models/errors/GetSessionHistoryErrors.md diff --git a/docs/models/errors/GetSessionHistoryResponseBody.md b/docs/models/errors/GetSessionHistoryResponseBody.md new file mode 100644 index 00000000..98b962d0 --- /dev/null +++ b/docs/models/errors/GetSessionHistoryResponseBody.md @@ -0,0 +1,11 @@ +# GetSessionHistoryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetSessionsErrors.md b/docs/models/errors/GetSessionsErrors.md similarity index 100% rename from docs/models/operations/GetSessionsErrors.md rename to docs/models/errors/GetSessionsErrors.md diff --git a/docs/models/errors/GetSessionsResponseBody.md b/docs/models/errors/GetSessionsResponseBody.md new file mode 100644 index 00000000..f18d6a50 --- /dev/null +++ b/docs/models/errors/GetSessionsResponseBody.md @@ -0,0 +1,11 @@ +# GetSessionsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetSourceConnectionInformationErrors.md b/docs/models/errors/GetSourceConnectionInformationErrors.md similarity index 100% rename from docs/models/operations/GetSourceConnectionInformationErrors.md rename to docs/models/errors/GetSourceConnectionInformationErrors.md diff --git a/docs/models/errors/GetSourceConnectionInformationResponseBody.md b/docs/models/errors/GetSourceConnectionInformationResponseBody.md new file mode 100644 index 00000000..43d60357 --- /dev/null +++ b/docs/models/errors/GetSourceConnectionInformationResponseBody.md @@ -0,0 +1,11 @@ +# GetSourceConnectionInformationResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetStatisticsErrors.md b/docs/models/errors/GetStatisticsErrors.md similarity index 100% rename from docs/models/operations/GetStatisticsErrors.md rename to docs/models/errors/GetStatisticsErrors.md diff --git a/docs/models/errors/GetStatisticsResponseBody.md b/docs/models/errors/GetStatisticsResponseBody.md new file mode 100644 index 00000000..1ae97853 --- /dev/null +++ b/docs/models/errors/GetStatisticsResponseBody.md @@ -0,0 +1,11 @@ +# GetStatisticsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetTimelineErrors.md b/docs/models/errors/GetTimelineErrors.md similarity index 100% rename from docs/models/operations/GetTimelineErrors.md rename to docs/models/errors/GetTimelineErrors.md diff --git a/docs/models/errors/GetTimelineResponseBody.md b/docs/models/errors/GetTimelineResponseBody.md new file mode 100644 index 00000000..99193424 --- /dev/null +++ b/docs/models/errors/GetTimelineResponseBody.md @@ -0,0 +1,11 @@ +# GetTimelineResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetTokenErrors.md b/docs/models/errors/GetTokenErrors.md similarity index 100% rename from docs/models/operations/GetTokenErrors.md rename to docs/models/errors/GetTokenErrors.md diff --git a/docs/models/errors/GetTokenResponseBody.md b/docs/models/errors/GetTokenResponseBody.md new file mode 100644 index 00000000..f474014f --- /dev/null +++ b/docs/models/errors/GetTokenResponseBody.md @@ -0,0 +1,11 @@ +# GetTokenResponseBody + +X-Plex-Client-Identifier is missing + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.GetTokenErrors](../../models/errors/GetTokenErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.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/GetTranscodeSessionsErrors.md b/docs/models/errors/GetTranscodeSessionsErrors.md similarity index 100% rename from docs/models/operations/GetTranscodeSessionsErrors.md rename to docs/models/errors/GetTranscodeSessionsErrors.md diff --git a/docs/models/errors/GetTranscodeSessionsResponseBody.md b/docs/models/errors/GetTranscodeSessionsResponseBody.md new file mode 100644 index 00000000..910d2e12 --- /dev/null +++ b/docs/models/errors/GetTranscodeSessionsResponseBody.md @@ -0,0 +1,11 @@ +# GetTranscodeSessionsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetTransientTokenErrors.md b/docs/models/errors/GetTransientTokenErrors.md similarity index 100% rename from docs/models/operations/GetTransientTokenErrors.md rename to docs/models/errors/GetTransientTokenErrors.md diff --git a/docs/models/errors/GetTransientTokenResponseBody.md b/docs/models/errors/GetTransientTokenResponseBody.md new file mode 100644 index 00000000..493f659d --- /dev/null +++ b/docs/models/errors/GetTransientTokenResponseBody.md @@ -0,0 +1,11 @@ +# GetTransientTokenResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/GetUpdateStatusErrors.md b/docs/models/errors/GetUpdateStatusErrors.md similarity index 100% rename from docs/models/operations/GetUpdateStatusErrors.md rename to docs/models/errors/GetUpdateStatusErrors.md diff --git a/docs/models/errors/GetUpdateStatusResponseBody.md b/docs/models/errors/GetUpdateStatusResponseBody.md new file mode 100644 index 00000000..3be63c7d --- /dev/null +++ b/docs/models/errors/GetUpdateStatusResponseBody.md @@ -0,0 +1,11 @@ +# GetUpdateStatusResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/GetWatchlistErrors.md b/docs/models/errors/GetWatchlistErrors.md new file mode 100644 index 00000000..ed5478ce --- /dev/null +++ b/docs/models/errors/GetWatchlistErrors.md @@ -0,0 +1,10 @@ +# GetWatchlistErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *Optional* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *Optional* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *Optional* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/errors/GetWatchlistResponseBody.md b/docs/models/errors/GetWatchlistResponseBody.md new file mode 100644 index 00000000..796cdeea --- /dev/null +++ b/docs/models/errors/GetWatchlistResponseBody.md @@ -0,0 +1,11 @@ +# GetWatchlistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/LogLineErrors.md b/docs/models/errors/LogLineErrors.md similarity index 100% rename from docs/models/operations/LogLineErrors.md rename to docs/models/errors/LogLineErrors.md diff --git a/docs/models/operations/GetMyPlexAccountServerResponseBody.md b/docs/models/errors/LogLineResponseBody.md similarity index 69% rename from docs/models/operations/GetMyPlexAccountServerResponseBody.md rename to docs/models/errors/LogLineResponseBody.md index ee33bc29..a257956d 100644 --- a/docs/models/operations/GetMyPlexAccountServerResponseBody.md +++ b/docs/models/errors/LogLineResponseBody.md @@ -1,4 +1,4 @@ -# GetMyPlexAccountServerResponseBody +# LogLineResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -7,4 +7,5 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountErrors](../../models/operations/GetMyPlexAccountErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/LogMultiLineErrors.md b/docs/models/errors/LogMultiLineErrors.md similarity index 100% rename from docs/models/operations/LogMultiLineErrors.md rename to docs/models/errors/LogMultiLineErrors.md diff --git a/docs/models/errors/LogMultiLineResponseBody.md b/docs/models/errors/LogMultiLineResponseBody.md new file mode 100644 index 00000000..f24c81cf --- /dev/null +++ b/docs/models/errors/LogMultiLineResponseBody.md @@ -0,0 +1,11 @@ +# LogMultiLineResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/MarkPlayedErrors.md b/docs/models/errors/MarkPlayedErrors.md similarity index 100% rename from docs/models/operations/MarkPlayedErrors.md rename to docs/models/errors/MarkPlayedErrors.md diff --git a/docs/models/errors/MarkPlayedResponseBody.md b/docs/models/errors/MarkPlayedResponseBody.md new file mode 100644 index 00000000..0759d9f4 --- /dev/null +++ b/docs/models/errors/MarkPlayedResponseBody.md @@ -0,0 +1,11 @@ +# MarkPlayedResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/MarkUnplayedErrors.md b/docs/models/errors/MarkUnplayedErrors.md similarity index 100% rename from docs/models/operations/MarkUnplayedErrors.md rename to docs/models/errors/MarkUnplayedErrors.md diff --git a/docs/models/errors/MarkUnplayedResponseBody.md b/docs/models/errors/MarkUnplayedResponseBody.md new file mode 100644 index 00000000..1e63d290 --- /dev/null +++ b/docs/models/errors/MarkUnplayedResponseBody.md @@ -0,0 +1,11 @@ +# MarkUnplayedResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/PerformSearchErrors.md b/docs/models/errors/PerformSearchErrors.md similarity index 100% rename from docs/models/operations/PerformSearchErrors.md rename to docs/models/errors/PerformSearchErrors.md diff --git a/docs/models/errors/PerformSearchResponseBody.md b/docs/models/errors/PerformSearchResponseBody.md new file mode 100644 index 00000000..34843b00 --- /dev/null +++ b/docs/models/errors/PerformSearchResponseBody.md @@ -0,0 +1,11 @@ +# PerformSearchResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/PerformVoiceSearchErrors.md b/docs/models/errors/PerformVoiceSearchErrors.md similarity index 100% rename from docs/models/operations/PerformVoiceSearchErrors.md rename to docs/models/errors/PerformVoiceSearchErrors.md diff --git a/docs/models/errors/PerformVoiceSearchResponseBody.md b/docs/models/errors/PerformVoiceSearchResponseBody.md new file mode 100644 index 00000000..376e05f2 --- /dev/null +++ b/docs/models/errors/PerformVoiceSearchResponseBody.md @@ -0,0 +1,11 @@ +# PerformVoiceSearchResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/RefreshLibraryErrors.md b/docs/models/errors/RefreshLibraryErrors.md similarity index 100% rename from docs/models/operations/RefreshLibraryErrors.md rename to docs/models/errors/RefreshLibraryErrors.md diff --git a/docs/models/errors/RefreshLibraryResponseBody.md b/docs/models/errors/RefreshLibraryResponseBody.md new file mode 100644 index 00000000..922c5c00 --- /dev/null +++ b/docs/models/errors/RefreshLibraryResponseBody.md @@ -0,0 +1,11 @@ +# RefreshLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.RefreshLibraryErrors](../../models/errors/RefreshLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.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/SearchLibraryErrors.md b/docs/models/errors/SearchLibraryErrors.md new file mode 100644 index 00000000..2cfa10cb --- /dev/null +++ b/docs/models/errors/SearchLibraryErrors.md @@ -0,0 +1,10 @@ +# SearchLibraryErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *Optional* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *Optional* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *Optional* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/errors/SearchLibraryResponseBody.md b/docs/models/errors/SearchLibraryResponseBody.md new file mode 100644 index 00000000..e53fbb23 --- /dev/null +++ b/docs/models/errors/SearchLibraryResponseBody.md @@ -0,0 +1,11 @@ +# SearchLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.SearchLibraryErrors](../../models/errors/SearchLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.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/StartAllTasksErrors.md b/docs/models/errors/StartAllTasksErrors.md similarity index 100% rename from docs/models/operations/StartAllTasksErrors.md rename to docs/models/errors/StartAllTasksErrors.md diff --git a/docs/models/errors/StartAllTasksResponseBody.md b/docs/models/errors/StartAllTasksResponseBody.md new file mode 100644 index 00000000..efbbeb56 --- /dev/null +++ b/docs/models/errors/StartAllTasksResponseBody.md @@ -0,0 +1,11 @@ +# StartAllTasksResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/StartTaskErrors.md b/docs/models/errors/StartTaskErrors.md similarity index 100% rename from docs/models/operations/StartTaskErrors.md rename to docs/models/errors/StartTaskErrors.md diff --git a/docs/models/errors/StartTaskResponseBody.md b/docs/models/errors/StartTaskResponseBody.md new file mode 100644 index 00000000..ea1621fb --- /dev/null +++ b/docs/models/errors/StartTaskResponseBody.md @@ -0,0 +1,11 @@ +# StartTaskResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/StartUniversalTranscodeErrors.md b/docs/models/errors/StartUniversalTranscodeErrors.md similarity index 100% rename from docs/models/operations/StartUniversalTranscodeErrors.md rename to docs/models/errors/StartUniversalTranscodeErrors.md diff --git a/docs/models/operations/AddPlaylistContentsPlaylistsResponseBody.md b/docs/models/errors/StartUniversalTranscodeResponseBody.md similarity index 69% rename from docs/models/operations/AddPlaylistContentsPlaylistsResponseBody.md rename to docs/models/errors/StartUniversalTranscodeResponseBody.md index 92eafc8f..16a4d1b5 100644 --- a/docs/models/operations/AddPlaylistContentsPlaylistsResponseBody.md +++ b/docs/models/errors/StartUniversalTranscodeResponseBody.md @@ -1,4 +1,4 @@ -# AddPlaylistContentsPlaylistsResponseBody +# StartUniversalTranscodeResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -7,4 +7,5 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsErrors](../../models/operations/AddPlaylistContentsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/StopAllTasksErrors.md b/docs/models/errors/StopAllTasksErrors.md similarity index 100% rename from docs/models/operations/StopAllTasksErrors.md rename to docs/models/errors/StopAllTasksErrors.md diff --git a/docs/models/errors/StopAllTasksResponseBody.md b/docs/models/errors/StopAllTasksResponseBody.md new file mode 100644 index 00000000..9b70570a --- /dev/null +++ b/docs/models/errors/StopAllTasksResponseBody.md @@ -0,0 +1,11 @@ +# StopAllTasksResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/StopTaskErrors.md b/docs/models/errors/StopTaskErrors.md similarity index 100% rename from docs/models/operations/StopTaskErrors.md rename to docs/models/errors/StopTaskErrors.md diff --git a/docs/models/operations/GetRecentlyAddedLibraryResponseBody.md b/docs/models/errors/StopTaskResponseBody.md similarity index 69% rename from docs/models/operations/GetRecentlyAddedLibraryResponseBody.md rename to docs/models/errors/StopTaskResponseBody.md index f320d7f4..4084cc4a 100644 --- a/docs/models/operations/GetRecentlyAddedLibraryResponseBody.md +++ b/docs/models/errors/StopTaskResponseBody.md @@ -1,4 +1,4 @@ -# GetRecentlyAddedLibraryResponseBody +# StopTaskResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -7,4 +7,5 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedErrors](../../models/operations/GetRecentlyAddedErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/StopTranscodeSessionErrors.md b/docs/models/errors/StopTranscodeSessionErrors.md similarity index 100% rename from docs/models/operations/StopTranscodeSessionErrors.md rename to docs/models/errors/StopTranscodeSessionErrors.md diff --git a/docs/models/errors/StopTranscodeSessionResponseBody.md b/docs/models/errors/StopTranscodeSessionResponseBody.md new file mode 100644 index 00000000..584e48fd --- /dev/null +++ b/docs/models/errors/StopTranscodeSessionResponseBody.md @@ -0,0 +1,11 @@ +# StopTranscodeSessionResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/UpdatePlayProgressErrors.md b/docs/models/errors/UpdatePlayProgressErrors.md similarity index 100% rename from docs/models/operations/UpdatePlayProgressErrors.md rename to docs/models/errors/UpdatePlayProgressErrors.md diff --git a/docs/models/errors/UpdatePlayProgressResponseBody.md b/docs/models/errors/UpdatePlayProgressResponseBody.md new file mode 100644 index 00000000..448194bc --- /dev/null +++ b/docs/models/errors/UpdatePlayProgressResponseBody.md @@ -0,0 +1,11 @@ +# UpdatePlayProgressResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/UpdatePlaylistErrors.md b/docs/models/errors/UpdatePlaylistErrors.md similarity index 100% rename from docs/models/operations/UpdatePlaylistErrors.md rename to docs/models/errors/UpdatePlaylistErrors.md diff --git a/docs/models/errors/UpdatePlaylistResponseBody.md b/docs/models/errors/UpdatePlaylistResponseBody.md new file mode 100644 index 00000000..2a1cdccc --- /dev/null +++ b/docs/models/errors/UpdatePlaylistResponseBody.md @@ -0,0 +1,11 @@ +# UpdatePlaylistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/UploadPlaylistErrors.md b/docs/models/errors/UploadPlaylistErrors.md similarity index 100% rename from docs/models/operations/UploadPlaylistErrors.md rename to docs/models/errors/UploadPlaylistErrors.md diff --git a/docs/models/errors/UploadPlaylistResponseBody.md b/docs/models/errors/UploadPlaylistResponseBody.md new file mode 100644 index 00000000..4470df95 --- /dev/null +++ b/docs/models/errors/UploadPlaylistResponseBody.md @@ -0,0 +1,11 @@ +# UploadPlaylistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[lukehagar.plexapi.plexapi.models.errors.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/operations/AddPlaylistContentsMediaContainer.md b/docs/models/operations/AddPlaylistContentsMediaContainer.md index 84aa4002..77af8d3d 100644 --- a/docs/models/operations/AddPlaylistContentsMediaContainer.md +++ b/docs/models/operations/AddPlaylistContentsMediaContainer.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `leafCountAdded` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `leafCountRequested` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsMetadata](../../models/operations/AddPlaylistContentsMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"ratingKey": "94",
"key": "/playlists/94/items",
"guid": "com.plexapp.agents.none://972e3047-83d6-4848-a000-261f0af26ba2",
"type": "playlist",
"title": "A great playlist",
"summary": "One of my great playlists",
"smart": false,
"playlistType": "video",
"composite": "/playlists/94/composite/1705800070",
"duration": 423000,
"leafCount": 3,
"addedAt": 1705716458,
"updatedAt": 1705800070
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `leafCountAdded` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `leafCountRequested` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsMetadata](../../models/operations/AddPlaylistContentsMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/AddPlaylistContentsResponse.md b/docs/models/operations/AddPlaylistContentsResponse.md index 9ad84394..886c5cce 100644 --- a/docs/models/operations/AddPlaylistContentsResponse.md +++ b/docs/models/operations/AddPlaylistContentsResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/AddPlaylistContentsResponseBody.md) | :heavy_minus_sign: | Playlist Updated | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/AddPlaylistContentsPlaylistsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/ApplyUpdatesRequest.md b/docs/models/operations/ApplyUpdatesRequest.md index cadff543..7e0aa3b9 100644 --- a/docs/models/operations/ApplyUpdatesRequest.md +++ b/docs/models/operations/ApplyUpdatesRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `tonight` | [Optional](../../models/operations/Tonight.md) | :heavy_minus_sign: | 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 | -| `skip` | [Optional](../../models/operations/Skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `tonight` | [Optional](../../models/operations/Tonight.md) | :heavy_minus_sign: | 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 | 1 | +| `skip` | [Optional](../../models/operations/Skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | 1 | \ No newline at end of file diff --git a/docs/models/operations/ApplyUpdatesResponse.md b/docs/models/operations/ApplyUpdatesResponse.md index 76df8e52..c2a35e61 100644 --- a/docs/models/operations/ApplyUpdatesResponse.md +++ b/docs/models/operations/ApplyUpdatesResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/ApplyUpdatesResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/ApplyUpdatesResponseBody.md b/docs/models/operations/ApplyUpdatesResponseBody.md deleted file mode 100644 index 4d4ec4ae..00000000 --- a/docs/models/operations/ApplyUpdatesResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# ApplyUpdatesResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesErrors](../../models/operations/ApplyUpdatesErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/CancelServerActivitiesRequest.md b/docs/models/operations/CancelServerActivitiesRequest.md index c2201c84..a8eef37a 100644 --- a/docs/models/operations/CancelServerActivitiesRequest.md +++ b/docs/models/operations/CancelServerActivitiesRequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `activityUUID` | *String* | :heavy_check_mark: | The UUID of the activity to cancel. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `activityUUID` | *String* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e | \ No newline at end of file diff --git a/docs/models/operations/CancelServerActivitiesResponse.md b/docs/models/operations/CancelServerActivitiesResponse.md index f3f5317b..6926bda9 100644 --- a/docs/models/operations/CancelServerActivitiesResponse.md +++ b/docs/models/operations/CancelServerActivitiesResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/CancelServerActivitiesResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/CancelServerActivitiesResponseBody.md b/docs/models/operations/CancelServerActivitiesResponseBody.md deleted file mode 100644 index 1a7e5398..00000000 --- a/docs/models/operations/CancelServerActivitiesResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# CancelServerActivitiesResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesErrors](../../models/operations/CancelServerActivitiesErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/CheckForUpdatesRequest.md b/docs/models/operations/CheckForUpdatesRequest.md index 58009149..da7a1057 100644 --- a/docs/models/operations/CheckForUpdatesRequest.md +++ b/docs/models/operations/CheckForUpdatesRequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `download` | [Optional](../../models/operations/Download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `download` | [Optional](../../models/operations/Download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 | \ No newline at end of file diff --git a/docs/models/operations/CheckForUpdatesResponse.md b/docs/models/operations/CheckForUpdatesResponse.md index f845a7a8..5169ba11 100644 --- a/docs/models/operations/CheckForUpdatesResponse.md +++ b/docs/models/operations/CheckForUpdatesResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/CheckForUpdatesResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/CheckForUpdatesResponseBody.md b/docs/models/operations/CheckForUpdatesResponseBody.md deleted file mode 100644 index 797d59f6..00000000 --- a/docs/models/operations/CheckForUpdatesResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# CheckForUpdatesResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesErrors](../../models/operations/CheckForUpdatesErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/ClearPlaylistContentsResponse.md b/docs/models/operations/ClearPlaylistContentsResponse.md index 73984fc3..aa4f9ea1 100644 --- a/docs/models/operations/ClearPlaylistContentsResponse.md +++ b/docs/models/operations/ClearPlaylistContentsResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/ClearPlaylistContentsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/CreatePlaylistMediaContainer.md b/docs/models/operations/CreatePlaylistMediaContainer.md index 3a8b4816..d74c0645 100644 --- a/docs/models/operations/CreatePlaylistMediaContainer.md +++ b/docs/models/operations/CreatePlaylistMediaContainer.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 7 | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.CreatePlaylistMetadata](../../models/operations/CreatePlaylistMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"ratingKey": "96",
"key": "/playlists/96/items",
"guid": "com.plexapp.agents.none://a2f92937-1408-40e2-b022-63a8a9377e55",
"type": "playlist",
"title": "A Great Playlist",
"summary": "What a great playlist",
"smart": false,
"playlistType": "video",
"icon": "playlist://image.smart",
"viewCount": 1,
"lastViewedAt": 1705719589,
"leafCount": 1,
"addedAt": 1705719589,
"updatedAt": 1705724593,
"composite": "/playlists/96/composite/1705724593",
"duration": 141000
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 7 | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.CreatePlaylistMetadata](../../models/operations/CreatePlaylistMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/CreatePlaylistPlaylistsResponseBody.md b/docs/models/operations/CreatePlaylistPlaylistsResponseBody.md deleted file mode 100644 index 4e0af524..00000000 --- a/docs/models/operations/CreatePlaylistPlaylistsResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# CreatePlaylistPlaylistsResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.CreatePlaylistErrors](../../models/operations/CreatePlaylistErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/CreatePlaylistResponse.md b/docs/models/operations/CreatePlaylistResponse.md index 23414a7e..d0023d6a 100644 --- a/docs/models/operations/CreatePlaylistResponse.md +++ b/docs/models/operations/CreatePlaylistResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/CreatePlaylistResponseBody.md) | :heavy_minus_sign: | returns all playlists | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/CreatePlaylistPlaylistsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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 5a4b2037..96c3bd52 100644 --- a/docs/models/operations/DeleteLibraryResponse.md +++ b/docs/models/operations/DeleteLibraryResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/DeleteLibraryResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/DeleteLibraryResponseBody.md b/docs/models/operations/DeleteLibraryResponseBody.md deleted file mode 100644 index 14cce9fd..00000000 --- a/docs/models/operations/DeleteLibraryResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteLibraryResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.DeleteLibraryErrors](../../models/operations/DeleteLibraryErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/DeletePlaylistResponse.md b/docs/models/operations/DeletePlaylistResponse.md index 36e96059..b8f7efaa 100644 --- a/docs/models/operations/DeletePlaylistResponse.md +++ b/docs/models/operations/DeletePlaylistResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/DeletePlaylistResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/DeletePlaylistResponseBody.md b/docs/models/operations/DeletePlaylistResponseBody.md deleted file mode 100644 index d214c316..00000000 --- a/docs/models/operations/DeletePlaylistResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeletePlaylistResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.DeletePlaylistErrors](../../models/operations/DeletePlaylistErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/EnablePaperTrailResponse.md b/docs/models/operations/EnablePaperTrailResponse.md index d80d7f90..7c7d9bf5 100644 --- a/docs/models/operations/EnablePaperTrailResponse.md +++ b/docs/models/operations/EnablePaperTrailResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/EnablePaperTrailResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/FieldType.md b/docs/models/operations/FieldType.md index 05c9b036..d1e12c70 100644 --- a/docs/models/operations/FieldType.md +++ b/docs/models/operations/FieldType.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | `type` | *Optional* | :heavy_minus_sign: | N/A | resolution | -| `operator` | List<[lukehagar.plexapi.plexapi.models.operations.Operator](../../models/operations/Operator.md)> | :heavy_minus_sign: | N/A | [
{
"key": "=",
"title": "is"
}
] | \ No newline at end of file +| `operator` | List<[lukehagar.plexapi.plexapi.models.operations.Operator](../../models/operations/Operator.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/Filter.md b/docs/models/operations/Filter.md index 483e5d6e..6b3af5a1 100644 --- a/docs/models/operations/Filter.md +++ b/docs/models/operations/Filter.md @@ -1,12 +1,11 @@ # Filter +Filters content by field and direction/equality +(Unknown if viewedAt is the only supported column) + + ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | -| `filter` | *Optional* | :heavy_minus_sign: | N/A | label | -| `filterType` | *Optional* | :heavy_minus_sign: | N/A | string | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1/label | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Labels | -| `type` | *Optional* | :heavy_minus_sign: | N/A | filter | \ No newline at end of file +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/GetAvailableClientsResponse.md b/docs/models/operations/GetAvailableClientsResponse.md index ab7f9bec..e594afa8 100644 --- a/docs/models/operations/GetAvailableClientsResponse.md +++ b/docs/models/operations/GetAvailableClientsResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetAvailableClientsResponseBody.md) | :heavy_minus_sign: | Available Clients | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetAvailableClientsServerResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetBandwidthStatisticsAccount.md b/docs/models/operations/GetBandwidthStatisticsAccount.md new file mode 100644 index 00000000..eed6f39c --- /dev/null +++ b/docs/models/operations/GetBandwidthStatisticsAccount.md @@ -0,0 +1,15 @@ +# GetBandwidthStatisticsAccount + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 238960586 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /accounts/238960586 | +| `name` | *Optional* | :heavy_minus_sign: | N/A | Diane | +| `defaultAudioLanguage` | *Optional* | :heavy_minus_sign: | N/A | en | +| `autoSelectAudio` | *Optional* | :heavy_minus_sign: | N/A | true | +| `defaultSubtitleLanguage` | *Optional* | :heavy_minus_sign: | N/A | en | +| `subtitleMode` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | https://plex.tv/users/50d83634246da1de/avatar?c=1707110967 | \ No newline at end of file diff --git a/docs/models/operations/GetBandwidthStatisticsDevice.md b/docs/models/operations/GetBandwidthStatisticsDevice.md new file mode 100644 index 00000000..a98ee64d --- /dev/null +++ b/docs/models/operations/GetBandwidthStatisticsDevice.md @@ -0,0 +1,12 @@ +# GetBandwidthStatisticsDevice + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 208 | +| `name` | *Optional* | :heavy_minus_sign: | N/A | Roku Express | +| `platform` | *Optional* | :heavy_minus_sign: | N/A | Roku | +| `clientIdentifier` | *Optional* | :heavy_minus_sign: | N/A | 793095d235660625108ef785cc7646e9 | +| `createdAt` | *Optional* | :heavy_minus_sign: | N/A | 1706470556 | \ No newline at end of file diff --git a/docs/models/operations/GetBandwidthStatisticsMediaContainer.md b/docs/models/operations/GetBandwidthStatisticsMediaContainer.md new file mode 100644 index 00000000..0431732b --- /dev/null +++ b/docs/models/operations/GetBandwidthStatisticsMediaContainer.md @@ -0,0 +1,11 @@ +# GetBandwidthStatisticsMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 5497 | +| `device` | List<[lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsDevice](../../models/operations/GetBandwidthStatisticsDevice.md)> | :heavy_minus_sign: | N/A | | +| `account` | List<[lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsAccount](../../models/operations/GetBandwidthStatisticsAccount.md)> | :heavy_minus_sign: | N/A | | +| `statisticsBandwidth` | List<[lukehagar.plexapi.plexapi.models.operations.StatisticsBandwidth](../../models/operations/StatisticsBandwidth.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetBandwidthStatisticsRequest.md b/docs/models/operations/GetBandwidthStatisticsRequest.md new file mode 100644 index 00000000..2d4edb8f --- /dev/null +++ b/docs/models/operations/GetBandwidthStatisticsRequest.md @@ -0,0 +1,8 @@ +# GetBandwidthStatisticsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `timespan` | *Optional* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | \ No newline at end of file diff --git a/docs/models/operations/GetBandwidthStatisticsResponse.md b/docs/models/operations/GetBandwidthStatisticsResponse.md new file mode 100644 index 00000000..bda025cb --- /dev/null +++ b/docs/models/operations/GetBandwidthStatisticsResponse.md @@ -0,0 +1,11 @@ +# GetBandwidthStatisticsResponse + + +## 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 diff --git a/docs/models/operations/GetBandwidthStatisticsResponseBody.md b/docs/models/operations/GetBandwidthStatisticsResponseBody.md new file mode 100644 index 00000000..2d13d16f --- /dev/null +++ b/docs/models/operations/GetBandwidthStatisticsResponseBody.md @@ -0,0 +1,10 @@ +# GetBandwidthStatisticsResponseBody + +Bandwidth Statistics + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `mediaContainer` | [Optional](../../models/operations/GetBandwidthStatisticsMediaContainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetButlerTasksButlerResponseBody.md b/docs/models/operations/GetButlerTasksButlerResponseBody.md deleted file mode 100644 index 624a037f..00000000 --- a/docs/models/operations/GetButlerTasksButlerResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetButlerTasksButlerResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetButlerTasksErrors](../../models/operations/GetButlerTasksErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetButlerTasksResponse.md b/docs/models/operations/GetButlerTasksResponse.md index 926c9629..42cb8b0d 100644 --- a/docs/models/operations/GetButlerTasksResponse.md +++ b/docs/models/operations/GetButlerTasksResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetButlerTasksResponseBody.md) | :heavy_minus_sign: | All butler tasks | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetButlerTasksButlerResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetDevicesResponse.md b/docs/models/operations/GetDevicesResponse.md index e6832ad8..3a860955 100644 --- a/docs/models/operations/GetDevicesResponse.md +++ b/docs/models/operations/GetDevicesResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetDevicesResponseBody.md) | :heavy_minus_sign: | Devices | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetDevicesServerResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetDevicesServerResponseBody.md b/docs/models/operations/GetDevicesServerResponseBody.md deleted file mode 100644 index 61763e48..00000000 --- a/docs/models/operations/GetDevicesServerResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetDevicesServerResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetDevicesErrors](../../models/operations/GetDevicesErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetFileHashResponse.md b/docs/models/operations/GetFileHashResponse.md index 2ea283df..92bc1ba0 100644 --- a/docs/models/operations/GetFileHashResponse.md +++ b/docs/models/operations/GetFileHashResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/GetFileHashResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetFileHashResponseBody.md b/docs/models/operations/GetFileHashResponseBody.md deleted file mode 100644 index d8389587..00000000 --- a/docs/models/operations/GetFileHashResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetFileHashResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetFileHashErrors](../../models/operations/GetFileHashErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetGlobalHubsHubsResponseBody.md b/docs/models/operations/GetGlobalHubsHubsResponseBody.md deleted file mode 100644 index 1f577c71..00000000 --- a/docs/models/operations/GetGlobalHubsHubsResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetGlobalHubsHubsResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsErrors](../../models/operations/GetGlobalHubsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetGlobalHubsMediaContainer.md b/docs/models/operations/GetGlobalHubsMediaContainer.md index 1965cd64..0341d83b 100644 --- a/docs/models/operations/GetGlobalHubsMediaContainer.md +++ b/docs/models/operations/GetGlobalHubsMediaContainer.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 8 | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | -| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `hub` | List<[lukehagar.plexapi.plexapi.models.operations.Hub](../../models/operations/Hub.md)> | :heavy_minus_sign: | N/A | [
{
"hubKey": "/library/metadata/50768,65523,58188,57341,57302,57070",
"key": "/playlists/all?type=15\u0026sort=lastViewedAt:desc\u0026playlistType=video,audio",
"title": "Recent Playlists",
"type": "playlist",
"hubIdentifier": "home.playlists",
"context": "hub.home.playlists",
"size": 6,
"more": true,
"style": "shelf",
"promoted": true,
"Metadata": [
{
"ratingKey": "50768",
"key": "/playlists/50768/items",
"guid": "com.plexapp.agents.none://81658e0d-cd4e-4c73-abb9-832b2ae2037b",
"type": "playlist",
"title": "❤️ Tracks",
"titleSort": "Tracks",
"summary": "All your highly rated tracks, in one convenient place.",
"smart": true,
"playlistType": "audio",
"composite": "/playlists/50768/composite/1704333758",
"icon": "playlist://image.smart",
"viewCount": 47,
"lastViewedAt": 1705329935,
"duration": 42864000,
"leafCount": 178,
"addedAt": 1655309388,
"updatedAt": 1704333758
},
{
"ratingKey": "65523",
"key": "/playlists/65523/items",
"guid": "com.plexapp.agents.none://1bcdd596-892b-4856-9f28-b4338c439300",
"type": "playlist",
"title": "Car Rides",
"summary": "",
"smart": false,
"playlistType": "audio",
"composite": "/playlists/65523/composite/1698597932",
"viewCount": 2,
"lastViewedAt": 1698597949,
"duration": 4864000,
"leafCount": 19,
"addedAt": 1697993545,
"updatedAt": 1698597932
},
{
"ratingKey": "58188",
"key": "/playlists/58188/items",
"guid": "com.plexapp.agents.none://8f0441d3-2a28-4644-a2f1-b7deeb290dff",
"type": "playlist",
"title": "Workout",
"summary": "",
"smart": false,
"playlistType": "audio",
"composite": "/playlists/58188/composite/1680825595",
"viewCount": 4,
"lastViewedAt": 1680825596,
"duration": 12522000,
"leafCount": 56,
"addedAt": 1679616785,
"updatedAt": 1680825595
},
{
"ratingKey": "57341",
"key": "/playlists/57341/items",
"guid": "com.plexapp.agents.none://bf8778c3-20a3-4619-8eb0-3c172c18ffd6",
"type": "playlist",
"title": "January Movie Day",
"summary": "",
"smart": false,
"playlistType": "video",
"composite": "/playlists/57341/composite/1673372385",
"viewCount": 1,
"lastViewedAt": 1673372306,
"duration": 19119000,
"leafCount": 3,
"addedAt": 1673372306,
"updatedAt": 1673372385
},
{
"ratingKey": "57302",
"key": "/playlists/57302/items",
"guid": "com.plexapp.agents.none://f25064ed-05bb-4bcf-b70c-ed7514b70929",
"type": "playlist",
"title": "December Movie Day",
"summary": "",
"smart": false,
"playlistType": "video",
"composite": "/playlists/57302/composite/1671205874",
"viewCount": 2,
"lastViewedAt": 1671206853,
"duration": 23040000,
"leafCount": 3,
"addedAt": 1671197078,
"updatedAt": 1671205874
},
{
"ratingKey": "57070",
"key": "/playlists/57070/items",
"guid": "com.plexapp.agents.none://9fee6c5b-3143-4923-813e-57bd0190056c",
"type": "playlist",
"title": "November Movie Day",
"summary": "",
"smart": false,
"playlistType": "video",
"composite": "/playlists/57070/composite/1668787730",
"viewCount": 2,
"lastViewedAt": 1668787732,
"duration": 16873000,
"leafCount": 3,
"addedAt": 1668779618,
"updatedAt": 1668787730
}
]
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 8 | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | +| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `hub` | List<[lukehagar.plexapi.plexapi.models.operations.Hub](../../models/operations/Hub.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetGlobalHubsResponse.md b/docs/models/operations/GetGlobalHubsResponse.md index 48943e6c..7a720048 100644 --- a/docs/models/operations/GetGlobalHubsResponse.md +++ b/docs/models/operations/GetGlobalHubsResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetGlobalHubsResponseBody.md) | :heavy_minus_sign: | returns global hubs | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetGlobalHubsHubsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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 new file mode 100644 index 00000000..6275a5f6 --- /dev/null +++ b/docs/models/operations/GetHomeDataResponse.md @@ -0,0 +1,11 @@ +# GetHomeDataResponse + + +## 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 diff --git a/docs/models/operations/GetHomeDataResponseBody.md b/docs/models/operations/GetHomeDataResponseBody.md new file mode 100644 index 00000000..8043fc45 --- /dev/null +++ b/docs/models/operations/GetHomeDataResponseBody.md @@ -0,0 +1,15 @@ +# GetHomeDataResponseBody + +Home Data + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 1841489 | +| `name` | *Optional* | :heavy_minus_sign: | N/A | Blindkitty38's home | +| `guestUserID` | *Optional* | :heavy_minus_sign: | N/A | 58815432 | +| `guestUserUUID` | *Optional* | :heavy_minus_sign: | N/A | f3df4e01bfca0787 | +| `guestEnabled` | *Optional* | :heavy_minus_sign: | N/A | | +| `subscription` | *Optional* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetLibrariesDirectory.md b/docs/models/operations/GetLibrariesDirectory.md index 037ccd47..e79e8427 100644 --- a/docs/models/operations/GetLibrariesDirectory.md +++ b/docs/models/operations/GetLibrariesDirectory.md @@ -25,4 +25,4 @@ | `directory` | *Optional* | :heavy_minus_sign: | N/A | true | | `contentChangedAt` | *Optional* | :heavy_minus_sign: | N/A | 3192854 | | `hidden` | *Optional* | :heavy_minus_sign: | N/A | 0 | -| `location` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibrariesLocation](../../models/operations/GetLibrariesLocation.md)> | :heavy_minus_sign: | N/A | [
{
"id": 1,
"path": "/movies"
}
] | \ No newline at end of file +| `location` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibrariesLocation](../../models/operations/GetLibrariesLocation.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetLibrariesLibraryResponseBody.md b/docs/models/operations/GetLibrariesLibraryResponseBody.md deleted file mode 100644 index b5dae85a..00000000 --- a/docs/models/operations/GetLibrariesLibraryResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibrariesLibraryResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibrariesErrors](../../models/operations/GetLibrariesErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetLibrariesMediaContainer.md b/docs/models/operations/GetLibrariesMediaContainer.md index 458848a8..67444f39 100644 --- a/docs/models/operations/GetLibrariesMediaContainer.md +++ b/docs/models/operations/GetLibrariesMediaContainer.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 5 | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | false | -| `title1` | *Optional* | :heavy_minus_sign: | N/A | Plex Library | -| `directory` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibrariesDirectory](../../models/operations/GetLibrariesDirectory.md)> | :heavy_minus_sign: | N/A | [
{
"allowSync": true,
"art": "/:/resources/movie-fanart.jpg",
"composite": "/library/sections/1/composite/1705615584",
"filters": true,
"refreshing": false,
"thumb": "/:/resources/movie.png",
"key": "1",
"type": "movie",
"title": "Movies",
"agent": "tv.plex.agents.movie",
"scanner": "Plex Movie",
"language": "en-US",
"uuid": "322a231a-b7f7-49f5-920f-14c61199cd30",
"updatedAt": 1705615634,
"createdAt": 1654131312,
"scannedAt": 1705615584,
"content": true,
"directory": true,
"contentChangedAt": 3192854,
"hidden": 0,
"Location": [
{
"id": 1,
"path": "/movies"
}
]
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 5 | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | false | +| `title1` | *Optional* | :heavy_minus_sign: | N/A | Plex Library | +| `directory` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibrariesDirectory](../../models/operations/GetLibrariesDirectory.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetLibrariesResponse.md b/docs/models/operations/GetLibrariesResponse.md index 468b6d18..c7c028b6 100644 --- a/docs/models/operations/GetLibrariesResponse.md +++ b/docs/models/operations/GetLibrariesResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetLibrariesResponseBody.md) | :heavy_minus_sign: | The libraries available on the Server | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetLibrariesLibraryResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetLibrariesResponseBody.md) | :heavy_minus_sign: | The libraries available on the Server | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryFilter.md b/docs/models/operations/GetLibraryFilter.md new file mode 100644 index 00000000..e01df2de --- /dev/null +++ b/docs/models/operations/GetLibraryFilter.md @@ -0,0 +1,12 @@ +# GetLibraryFilter + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `filter` | *Optional* | :heavy_minus_sign: | N/A | label | +| `filterType` | *Optional* | :heavy_minus_sign: | N/A | string | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1/label | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Labels | +| `type` | *Optional* | :heavy_minus_sign: | N/A | filter | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryHubsHub.md b/docs/models/operations/GetLibraryHubsHub.md index b131b41a..f673b3a6 100644 --- a/docs/models/operations/GetLibraryHubsHub.md +++ b/docs/models/operations/GetLibraryHubsHub.md @@ -3,17 +3,17 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1/all?sort=lastViewedAt:desc&unwatched=0&viewOffset=0 | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Recently Played Movies | -| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `hubIdentifier` | *Optional* | :heavy_minus_sign: | N/A | movie.recentlyviewed.1 | -| `context` | *Optional* | :heavy_minus_sign: | N/A | hub.movie.recentlyviewed | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 6 | -| `more` | *Optional* | :heavy_minus_sign: | N/A | true | -| `style` | *Optional* | :heavy_minus_sign: | N/A | shelf | -| `hubKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66485,66098,57249,11449,5858,14944 | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsMetadata](../../models/operations/GetLibraryHubsMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"ratingKey": "14944",
"key": "/library/metadata/14944",
"guid": "plex://movie/5d77686eeb5d26001f1eb339",
"studio": "Walt Disney Animation Studios",
"type": "movie",
"title": "Tangled",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "PG",
"summary": "The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is.",
"rating": 8.9,
"audienceRating": 8.7,
"viewCount": 1,
"lastViewedAt": 1704936047,
"year": 2010,
"tagline": "They're taking adventure to new lengths.",
"thumb": "/library/metadata/14944/thumb/1705739847",
"art": "/library/metadata/14944/art/1705739847",
"duration": 6017237,
"originallyAvailableAt": "2010-11-24T00:00:00Z",
"addedAt": 1589412494,
"updatedAt": 1705739847,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"primaryExtraKey": "/library/metadata/14952",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 38247,
"duration": 6017237,
"bitrate": 2051,
"width": 1920,
"height": 1080,
"aspectRatio": 1.78,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 1,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 38247,
"key": "/library/parts/38247/1589412494/file.mp4",
"duration": 6017237,
"file": "/movies/Tangled (2010)/Tangled (2010) Bluray-1080p.mp4",
"size": 1545647447,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": true,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Comedy"
},
{
"tag": "Animation"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Byron Howard"
},
{
"tag": "Nathan Greno"
}
],
"Role": [
{
"tag": "Mandy Moore"
},
{
"tag": "Zachary Levi"
},
{
"tag": "Donna Murphy"
}
],
"Writer": [
{
"tag": "Jacob Grimm"
},
{
"tag": "Wilhelm Grimm"
}
],
"skipCount": 1,
"chapterSource": "media"
}
] | -| `promoted` | *Optional* | :heavy_minus_sign: | N/A | true | -| `random` | *Optional* | :heavy_minus_sign: | N/A | true | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1/all?sort=lastViewedAt:desc&unwatched=0&viewOffset=0 | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Recently Played Movies | +| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | +| `hubIdentifier` | *Optional* | :heavy_minus_sign: | N/A | movie.recentlyviewed.1 | +| `context` | *Optional* | :heavy_minus_sign: | N/A | hub.movie.recentlyviewed | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 6 | +| `more` | *Optional* | :heavy_minus_sign: | N/A | true | +| `style` | *Optional* | :heavy_minus_sign: | N/A | shelf | +| `hubKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66485,66098,57249,11449,5858,14944 | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsMetadata](../../models/operations/GetLibraryHubsMetadata.md)> | :heavy_minus_sign: | N/A | | +| `promoted` | *Optional* | :heavy_minus_sign: | N/A | true | +| `random` | *Optional* | :heavy_minus_sign: | N/A | true | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryHubsHubsResponseBody.md b/docs/models/operations/GetLibraryHubsHubsResponseBody.md deleted file mode 100644 index 20db4015..00000000 --- a/docs/models/operations/GetLibraryHubsHubsResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryHubsHubsResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsErrors](../../models/operations/GetLibraryHubsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryHubsMedia.md b/docs/models/operations/GetLibraryHubsMedia.md index f96518fd..0fe96c7c 100644 --- a/docs/models/operations/GetLibraryHubsMedia.md +++ b/docs/models/operations/GetLibraryHubsMedia.md @@ -3,22 +3,22 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `id` | *Optional* | :heavy_minus_sign: | N/A | 38247 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 6017237 | -| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 2051 | -| `width` | *Optional* | :heavy_minus_sign: | N/A | 1920 | -| `height` | *Optional* | :heavy_minus_sign: | N/A | 1080 | -| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 1.78 | -| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 2 | -| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | aac | -| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | h264 | -| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 1080 | -| `container` | *Optional* | :heavy_minus_sign: | N/A | mp4 | -| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | -| `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | lc | -| `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | -| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | high | -| `part` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsPart](../../models/operations/GetLibraryHubsPart.md)> | :heavy_minus_sign: | N/A | [
{
"id": 38247,
"key": "/library/parts/38247/1589412494/file.mp4",
"duration": 6017237,
"file": "/movies/Tangled (2010)/Tangled (2010) Bluray-1080p.mp4",
"size": 1545647447,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": true,
"videoProfile": "high"
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 38247 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 6017237 | +| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 2051 | +| `width` | *Optional* | :heavy_minus_sign: | N/A | 1920 | +| `height` | *Optional* | :heavy_minus_sign: | N/A | 1080 | +| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 1.78 | +| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 2 | +| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | aac | +| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | h264 | +| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 1080 | +| `container` | *Optional* | :heavy_minus_sign: | N/A | mp4 | +| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | +| `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | lc | +| `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | high | +| `part` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsPart](../../models/operations/GetLibraryHubsPart.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryHubsMediaContainer.md b/docs/models/operations/GetLibraryHubsMediaContainer.md index 82874230..96a92797 100644 --- a/docs/models/operations/GetLibraryHubsMediaContainer.md +++ b/docs/models/operations/GetLibraryHubsMediaContainer.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 7 | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | -| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | -| `hub` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsHub](../../models/operations/GetLibraryHubsHub.md)> | :heavy_minus_sign: | N/A | [
{
"key": "/library/sections/1/all?sort=lastViewedAt:desc\u0026unwatched=0\u0026viewOffset=0",
"title": "Recently Played Movies",
"type": "movie",
"hubIdentifier": "movie.recentlyviewed.1",
"context": "hub.movie.recentlyviewed",
"size": 6,
"more": true,
"style": "shelf",
"hubKey": "/library/metadata/66485,66098,57249,11449,5858,14944",
"Metadata": [
{
"ratingKey": "66485",
"key": "/library/metadata/66485",
"guid": "plex://movie/5d776c3251dd69001fe38bb4",
"studio": "Termite Films",
"type": "movie",
"title": "Kedi",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "Not Rated",
"summary": "A profile of an ancient city and its unique people, seen through the eyes of the most mysterious and beloved animal humans have ever known, the Cat.",
"rating": 9.8,
"audienceRating": 8.5,
"viewCount": 2,
"lastViewedAt": 1705786111,
"year": 2017,
"tagline": "A cat meowing at your feet, looking up at you, is life smiling at you...",
"thumb": "/library/metadata/66485/thumb/1702586907",
"art": "/library/metadata/66485/art/1702586907",
"duration": 4736174,
"originallyAvailableAt": "2017-02-10T00:00:00Z",
"addedAt": 1702586905,
"updatedAt": 1702586907,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"primaryExtraKey": "/library/metadata/66486",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 129531,
"duration": 4736174,
"bitrate": 2377,
"width": 1920,
"height": 1080,
"aspectRatio": 1.78,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 0,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 129778,
"key": "/library/parts/129778/1702586883/file.mp4",
"duration": 4736174,
"file": "/movies/Kedi (2017)/Kedi (2017) 1080p x264.mp4",
"size": 1410810905,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": false,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Documentary"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Ceyda Torun"
}
],
"Role": [
{
"tag": "Bülent Üstün"
}
]
},
{
"ratingKey": "66098",
"key": "/library/metadata/66098",
"guid": "plex://movie/5d9f34f4adeb7a0021ce020f",
"studio": "Touchwood Pacific Partners 1",
"type": "movie",
"title": "Homeward Bound: The Incredible Journey",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "G",
"summary": "A fun-loving American bulldog pup, a hilarious Himalayan cat, and a wise old golden retriever embark on a long trek through the rugged wilderness of the Sierra Nevada mountains in a quest to reach home and their beloved owners.",
"rating": 8.7,
"audienceRating": 7.1,
"viewCount": 2,
"lastViewedAt": 1705709811,
"year": 1993,
"tagline": "In the classic tradition of Walt Disney Pictures comes a story about courage, adventure and friendship.",
"thumb": "/library/metadata/66098/thumb/1703148781",
"art": "/library/metadata/66098/art/1703148781",
"duration": 5065775,
"originallyAvailableAt": "1993-02-12T00:00:00Z",
"addedAt": 1700434925,
"updatedAt": 1703148781,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"primaryExtraKey": "/library/metadata/66099",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 129003,
"duration": 5065775,
"bitrate": 2444,
"width": 1904,
"height": 1024,
"aspectRatio": 1.85,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 1,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 129250,
"key": "/library/parts/129250/1700434864/file.mp4",
"duration": 5065775,
"file": "/movies/Homeward Bound The Incredible Journey (1993)/Homeward Bound The Incredible Journey (1993) [BluRay] [1080p] [YTS.LT].mp4",
"size": 1550855333,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": true,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Adventure"
},
{
"tag": "Comedy"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Duwayne Dunham"
}
],
"Writer": [
{
"tag": "Caroline Thompson"
},
{
"tag": "Linda Woolverton"
}
],
"Role": [
{
"tag": "Michael J. Fox"
},
{
"tag": "Sally Field"
},
{
"tag": "Don Ameche"
}
]
},
{
"ratingKey": "57249",
"key": "/library/metadata/57249",
"guid": "plex://movie/60eff7d3e22797002c55c1cc",
"studio": "Nickelodeon Movies",
"type": "movie",
"title": "Blue's Big City Adventure",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "TV-Y",
"summary": "Josh and Blue skidoo to New York City to audition for Rainbow Puppy's Broadway musical, but they get lost when Josh accidentally left his Handy Dandy Notebook at home. This leads to a game of Blue's Clues to figure out where the audition is. Meanwhile, Tickety Tock and her friends go to New York City to find Josh and Blue and get to the audition with help from Joe and Steve.",
"rating": 8.3,
"audienceRating": 8.6,
"viewCount": 8,
"skipCount": 1,
"lastViewedAt": 1705681955,
"year": 2022,
"tagline": "All They Need is You.",
"thumb": "/library/metadata/57249/thumb/1704274800",
"art": "/library/metadata/57249/art/1704274800",
"duration": 4459050,
"originallyAvailableAt": "2022-11-18T00:00:00Z",
"addedAt": 1669671356,
"updatedAt": 1704274800,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"primaryExtraKey": "/library/metadata/57250",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 115470,
"duration": 4459050,
"bitrate": 6384,
"width": 3840,
"height": 2160,
"aspectRatio": 1.78,
"audioChannels": 6,
"audioCodec": "aac",
"videoCodec": "hevc",
"videoResolution": "4k",
"container": "mkv",
"videoFrameRate": "24p",
"audioProfile": "lc",
"videoProfile": "main 10",
"Part": [
{
"id": 115478,
"key": "/library/parts/115478/1669671340/file.mkv",
"duration": 4459050,
"file": "/movies/Blue's Big City Adventure (2022)/Blues.Big.City.Adventure.2022.2160p.4K.WEB.x265.10bit.AAC5.1-[YTS.MX].mkv",
"size": 3560750664,
"audioProfile": "lc",
"container": "mkv",
"videoProfile": "main 10"
}
]
}
],
"Genre": [
{
"tag": "Comedy"
},
{
"tag": "Family"
}
],
"Country": [
{
"tag": "Canada"
},
{
"tag": "Ireland"
}
],
"Director": [
{
"tag": "Matt Stawski"
}
],
"Writer": [
{
"tag": "Traci Paige Johnson"
},
{
"tag": "Todd Kessler"
}
],
"Role": [
{
"tag": "Joshua Dela Cruz"
},
{
"tag": "Steve Burns"
},
{
"tag": "Donovan Patton"
}
]
},
{
"ratingKey": "11449",
"key": "/library/metadata/11449",
"guid": "plex://movie/5d776edfad5437001f803cf9",
"studio": "Walt Disney Pictures",
"type": "movie",
"title": "Onward",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "PG",
"summary": "In a magical world full of technological advances, elven brothers Ian and Barley Lightfoot set out on an adventure to resurrect their late father for a day.",
"rating": 8.8,
"audienceRating": 9.5,
"viewCount": 3,
"lastViewedAt": 1705543126,
"year": 2020,
"tagline": "Their quest begineth.",
"thumb": "/library/metadata/11449/thumb/1705224000",
"art": "/library/metadata/11449/art/1705224000",
"duration": 6141428,
"originallyAvailableAt": "2020-03-04T00:00:00Z",
"addedAt": 1589237130,
"updatedAt": 1705224000,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"chapterSource": "media",
"primaryExtraKey": "/library/metadata/11470",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 29291,
"duration": 6141428,
"bitrate": 10977,
"width": 1920,
"height": 804,
"aspectRatio": 2.35,
"audioChannels": 8,
"audioCodec": "dca-ma",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mkv",
"videoFrameRate": "24p",
"audioProfile": "ma",
"videoProfile": "high",
"Part": [
{
"id": 29291,
"key": "/library/parts/29291/1589237130/file.mkv",
"duration": 6141428,
"file": "/movies/Onward (2020)/Onward (2020) Bluray-1080p.mkv",
"size": 8426669232,
"audioProfile": "ma",
"container": "mkv",
"videoProfile": "high"
}
]
},
{
"id": 29315,
"duration": 6142006,
"bitrate": 2639,
"width": 1920,
"height": 800,
"aspectRatio": 2.35,
"audioChannels": 6,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 1,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 29315,
"key": "/library/parts/29315/1629002847/file.mp4",
"duration": 6142006,
"file": "/movies/Onward (2020)/Onward (2020) WEBRip-1080p.mp4",
"size": 2026154995,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": true,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Animation"
},
{
"tag": "Comedy"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Dan Scanlon"
}
],
"Writer": [
{
"tag": "Kelsey Mann"
},
{
"tag": "Dan Scanlon"
}
],
"Role": [
{
"tag": "Tom Holland"
},
{
"tag": "Chris Pratt"
},
{
"tag": "Julia Louis-Dreyfus"
}
]
},
{
"ratingKey": "5858",
"key": "/library/metadata/5858",
"guid": "plex://movie/5d776b85594b2b001e6dc641",
"studio": "Walt Disney Pictures",
"type": "movie",
"title": "Frozen II",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "PG",
"summary": "Anna, Elsa, Kristoff, Olaf and Sven leave Arendelle to travel to an ancient, autumn-bound forest of an enchanted land. They set out to find the origin of Elsa's powers in order to save their kingdom.",
"rating": 7.7,
"audienceRating": 9.2,
"viewCount": 1,
"skipCount": 1,
"lastViewedAt": 1705337663,
"year": 2019,
"tagline": "The past is not what it seems.",
"thumb": "/library/metadata/5858/thumb/1704621922",
"art": "/library/metadata/5858/art/1704621922",
"duration": 6194042,
"originallyAvailableAt": "2019-11-20T00:00:00Z",
"addedAt": 1588207762,
"updatedAt": 1704621922,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"primaryExtraKey": "/library/metadata/5892",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 14954,
"duration": 6194042,
"bitrate": 2538,
"width": 1920,
"height": 800,
"aspectRatio": 2.35,
"audioChannels": 6,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 1,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 14954,
"key": "/library/parts/14954/1588207762/file.mp4",
"duration": 6194042,
"file": "/movies/Frozen II (2019)/Frozen II (2019) Bluray-1080p.mp4",
"size": 1969230037,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": true,
"videoProfile": "high"
}
]
},
{
"id": 14999,
"duration": 6244271,
"bitrate": 2536,
"width": 1920,
"height": 800,
"aspectRatio": 2.35,
"audioChannels": 6,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 1,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 14999,
"key": "/library/parts/14999/1629001526/file.mp4",
"duration": 6244271,
"file": "/movies/Frozen II (2019)/Frozen II (2019) WEBRip-1080p.mp4",
"size": 1983357282,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": true,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Adventure"
},
{
"tag": "Animation"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Chris Buck"
},
{
"tag": "Jennifer Lee"
}
],
"Writer": [
{
"tag": "Chris Buck"
},
{
"tag": "Hans Christian Andersen"
}
],
"Role": [
{
"tag": "Idina Menzel"
},
{
"tag": "Kristen Bell"
},
{
"tag": "Josh Gad"
}
]
},
{
"ratingKey": "14944",
"key": "/library/metadata/14944",
"guid": "plex://movie/5d77686eeb5d26001f1eb339",
"studio": "Walt Disney Animation Studios",
"type": "movie",
"title": "Tangled",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "PG",
"summary": "The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is.",
"rating": 8.9,
"audienceRating": 8.7,
"viewCount": 1,
"lastViewedAt": 1704936047,
"year": 2010,
"tagline": "They're taking adventure to new lengths.",
"thumb": "/library/metadata/14944/thumb/1705739847",
"art": "/library/metadata/14944/art/1705739847",
"duration": 6017237,
"originallyAvailableAt": "2010-11-24T00:00:00Z",
"addedAt": 1589412494,
"updatedAt": 1705739847,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"primaryExtraKey": "/library/metadata/14952",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 38247,
"duration": 6017237,
"bitrate": 2051,
"width": 1920,
"height": 1080,
"aspectRatio": 1.78,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 1,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 38247,
"key": "/library/parts/38247/1589412494/file.mp4",
"duration": 6017237,
"file": "/movies/Tangled (2010)/Tangled (2010) Bluray-1080p.mp4",
"size": 1545647447,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": true,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Comedy"
},
{
"tag": "Animation"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Byron Howard"
},
{
"tag": "Nathan Greno"
}
],
"Writer": [
{
"tag": "Jacob Grimm"
},
{
"tag": "Wilhelm Grimm"
}
],
"Role": [
{
"tag": "Mandy Moore"
},
{
"tag": "Zachary Levi"
},
{
"tag": "Donna Murphy"
}
]
}
],
"promoted": true,
"random": true
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 7 | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | +| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `hub` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsHub](../../models/operations/GetLibraryHubsHub.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryHubsMetadata.md b/docs/models/operations/GetLibraryHubsMetadata.md index a3165464..fd3a73f7 100644 --- a/docs/models/operations/GetLibraryHubsMetadata.md +++ b/docs/models/operations/GetLibraryHubsMetadata.md @@ -3,39 +3,39 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 14944 | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/14944 | -| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5d77686eeb5d26001f1eb339 | -| `studio` | *Optional* | :heavy_minus_sign: | N/A | Walt Disney Animation Studios | -| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Tangled | -| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `librarySectionKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1 | -| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG | -| `summary` | *Optional* | :heavy_minus_sign: | N/A | The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is. | -| `rating` | *Optional* | :heavy_minus_sign: | N/A | 8.9 | -| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 8.7 | -| `viewCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `lastViewedAt` | *Optional* | :heavy_minus_sign: | N/A | 1704936047 | -| `year` | *Optional* | :heavy_minus_sign: | N/A | 2010 | -| `tagline` | *Optional* | :heavy_minus_sign: | N/A | They're taking adventure to new lengths. | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/14944/thumb/1705739847 | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/14944/art/1705739847 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 6017237 | -| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2010-11-24 00:00:00 +0000 UTC | -| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1589412494 | -| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705739847 | -| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | -| `primaryExtraKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/14952 | -| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | -| `media` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsMedia](../../models/operations/GetLibraryHubsMedia.md)> | :heavy_minus_sign: | N/A | [
{
"id": 38247,
"duration": 6017237,
"bitrate": 2051,
"width": 1920,
"height": 1080,
"aspectRatio": 1.78,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 1,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 38247,
"key": "/library/parts/38247/1589412494/file.mp4",
"duration": 6017237,
"file": "/movies/Tangled (2010)/Tangled (2010) Bluray-1080p.mp4",
"size": 1545647447,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": true,
"videoProfile": "high"
}
]
}
] | -| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsGenre](../../models/operations/GetLibraryHubsGenre.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "Animation"
}
] | -| `country` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsCountry](../../models/operations/GetLibraryHubsCountry.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "United States of America"
}
] | -| `director` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsDirector](../../models/operations/GetLibraryHubsDirector.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "Nathan Greno"
}
] | -| `role` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRole](../../models/operations/GetLibraryHubsRole.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "Donna Murphy"
}
] | -| `writer` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsWriter](../../models/operations/GetLibraryHubsWriter.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "Wilhelm Grimm"
}
] | -| `skipCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `chapterSource` | *Optional* | :heavy_minus_sign: | N/A | media | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 14944 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/14944 | +| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5d77686eeb5d26001f1eb339 | +| `studio` | *Optional* | :heavy_minus_sign: | N/A | Walt Disney Animation Studios | +| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Tangled | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1 | +| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG | +| `summary` | *Optional* | :heavy_minus_sign: | N/A | The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is. | +| `rating` | *Optional* | :heavy_minus_sign: | N/A | 8.9 | +| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 8.7 | +| `viewCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `lastViewedAt` | *Optional* | :heavy_minus_sign: | N/A | 1704936047 | +| `year` | *Optional* | :heavy_minus_sign: | N/A | 2010 | +| `tagline` | *Optional* | :heavy_minus_sign: | N/A | They're taking adventure to new lengths. | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/14944/thumb/1705739847 | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/14944/art/1705739847 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 6017237 | +| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2010-11-24 00:00:00 +0000 UTC | +| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1589412494 | +| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705739847 | +| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `primaryExtraKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/14952 | +| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | +| `media` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsMedia](../../models/operations/GetLibraryHubsMedia.md)> | :heavy_minus_sign: | N/A | | +| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsGenre](../../models/operations/GetLibraryHubsGenre.md)> | :heavy_minus_sign: | N/A | | +| `country` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsCountry](../../models/operations/GetLibraryHubsCountry.md)> | :heavy_minus_sign: | N/A | | +| `director` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsDirector](../../models/operations/GetLibraryHubsDirector.md)> | :heavy_minus_sign: | N/A | | +| `role` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRole](../../models/operations/GetLibraryHubsRole.md)> | :heavy_minus_sign: | N/A | | +| `writer` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsWriter](../../models/operations/GetLibraryHubsWriter.md)> | :heavy_minus_sign: | N/A | | +| `skipCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `chapterSource` | *Optional* | :heavy_minus_sign: | N/A | media | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryHubsResponse.md b/docs/models/operations/GetLibraryHubsResponse.md index 195a2ff5..052608b9 100644 --- a/docs/models/operations/GetLibraryHubsResponse.md +++ b/docs/models/operations/GetLibraryHubsResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetLibraryHubsResponseBody.md) | :heavy_minus_sign: | The hubs specific to the library | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetLibraryHubsHubsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetLibraryItemsMedia.md b/docs/models/operations/GetLibraryItemsMedia.md index 96361f1e..5185ce17 100644 --- a/docs/models/operations/GetLibraryItemsMedia.md +++ b/docs/models/operations/GetLibraryItemsMedia.md @@ -3,19 +3,19 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *Optional* | :heavy_minus_sign: | N/A | 119534 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | -| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 25025 | -| `width` | *Optional* | :heavy_minus_sign: | N/A | 3840 | -| `height` | *Optional* | :heavy_minus_sign: | N/A | 2072 | -| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 1.85 | -| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 6 | -| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | eac3 | -| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | hevc | -| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 4k | -| `container` | *Optional* | :heavy_minus_sign: | N/A | mkv | -| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | -| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | main 10 | -| `part` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsPart](../../models/operations/GetLibraryItemsPart.md)> | :heavy_minus_sign: | N/A | [
{
"id": 119542,
"key": "/library/parts/119542/1680457526/file.mkv",
"duration": 11558112,
"file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv",
"size": 36158371307,
"container": "mkv",
"videoProfile": "main 10"
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 119534 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | +| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 25025 | +| `width` | *Optional* | :heavy_minus_sign: | N/A | 3840 | +| `height` | *Optional* | :heavy_minus_sign: | N/A | 2072 | +| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 1.85 | +| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 6 | +| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | eac3 | +| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | hevc | +| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 4k | +| `container` | *Optional* | :heavy_minus_sign: | N/A | mkv | +| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | main 10 | +| `part` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsPart](../../models/operations/GetLibraryItemsPart.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsMediaContainer.md b/docs/models/operations/GetLibraryItemsMediaContainer.md index f4426481..6d69e487 100644 --- a/docs/models/operations/GetLibraryItemsMediaContainer.md +++ b/docs/models/operations/GetLibraryItemsMediaContainer.md @@ -3,21 +3,21 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 70 | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | -| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | -| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1701731894 | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie.png | -| `title1` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `title2` | *Optional* | :heavy_minus_sign: | N/A | Recently Released | -| `viewGroup` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `viewMode` | *Optional* | :heavy_minus_sign: | N/A | 65592 | -| `mixedParents` | *Optional* | :heavy_minus_sign: | N/A | true | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsMetadata](../../models/operations/GetLibraryItemsMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"ratingKey": "58683",
"key": "/library/metadata/58683",
"guid": "plex://movie/5d7768ba96b655001fdc0408",
"studio": "20th Century Studios",
"type": "movie",
"title": "Avatar: The Way of Water",
"contentRating": "PG-13",
"summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.",
"rating": 7.6,
"audienceRating": 9.2,
"year": 2022,
"tagline": "Return to Pandora.",
"thumb": "/library/metadata/58683/thumb/1703239236",
"art": "/library/metadata/58683/art/1703239236",
"duration": 11558112,
"originallyAvailableAt": "2022-12-14T00:00:00Z",
"addedAt": 1680457607,
"updatedAt": 1703239236,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"chapterSource": "media",
"primaryExtraKey": "/library/metadata/58684",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 119534,
"duration": 11558112,
"bitrate": 25025,
"width": 3840,
"height": 2072,
"aspectRatio": 1.85,
"audioChannels": 6,
"audioCodec": "eac3",
"videoCodec": "hevc",
"videoResolution": "4k",
"container": "mkv",
"videoFrameRate": "24p",
"videoProfile": "main 10",
"Part": [
{
"id": 119542,
"key": "/library/parts/119542/1680457526/file.mkv",
"duration": 11558112,
"file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv",
"size": 36158371307,
"container": "mkv",
"videoProfile": "main 10"
}
]
}
],
"Genre": [
{
"tag": "Action"
},
{
"tag": "Adventure"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "James Cameron"
}
],
"Writer": [
{
"tag": "Josh Friedman"
},
{
"tag": "James Cameron"
}
],
"Role": [
{
"tag": "Sam Worthington"
},
{
"tag": "Zoe Saldaña"
},
{
"tag": "Sigourney Weaver"
}
],
"titleSort": "Whale",
"viewCount": 1,
"lastViewedAt": 1682752242,
"originalTitle": "映画 ブラッククローバー 魔法帝の剣",
"viewOffset": 5222500,
"skipCount": 1,
"index": 1,
"theme": "/library/metadata/1/theme/1705636920",
"leafCount": 14,
"viewedLeafCount": 0,
"childCount": 1,
"hasPremiumExtras": "1",
"hasPremiumPrimaryExtra": "1",
"parentRatingKey": "66",
"parentGuid": "plex://show/5d9c081b170e24001f2a7be4",
"parentStudio": "UCP",
"parentKey": "/library/metadata/66",
"parentTitle": "Caprica",
"parentIndex": 1,
"parentYear": 2010,
"parentThumb": "/library/metadata/66/thumb/1705716261",
"parentTheme": "/library/metadata/66/theme/1705716261",
"grandparentRatingKey": "66",
"grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4",
"grandparentKey": "/library/metadata/66",
"grandparentTitle": "Caprica",
"grandparentThumb": "/library/metadata/66/thumb/1705716261",
"grandparentArt": "/library/metadata/66/art/1705716261",
"grandparentTheme": "/library/metadata/66/theme/1705716261"
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 70 | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | +| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `librarySectionID` | [Optional](../../models/operations/LibrarySectionID.md) | :heavy_minus_sign: | N/A | | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1701731894 | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie.png | +| `title1` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `title2` | *Optional* | :heavy_minus_sign: | N/A | Recently Released | +| `viewGroup` | *Optional* | :heavy_minus_sign: | N/A | movie | +| `viewMode` | *Optional* | :heavy_minus_sign: | N/A | 65592 | +| `mixedParents` | *Optional* | :heavy_minus_sign: | N/A | true | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsMetadata](../../models/operations/GetLibraryItemsMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsMetadata.md b/docs/models/operations/GetLibraryItemsMetadata.md index a8414259..77ae46ce 100644 --- a/docs/models/operations/GetLibraryItemsMetadata.md +++ b/docs/models/operations/GetLibraryItemsMetadata.md @@ -3,62 +3,62 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 58683 | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683 | -| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5d7768ba96b655001fdc0408 | -| `studio` | *Optional* | :heavy_minus_sign: | N/A | 20th Century Studios | -| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Avatar: The Way of Water | -| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | -| `summary` | *Optional* | :heavy_minus_sign: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. | -| `rating` | *Optional* | :heavy_minus_sign: | N/A | 7.6 | -| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 9.2 | -| `year` | *Optional* | :heavy_minus_sign: | N/A | 2022 | -| `tagline` | *Optional* | :heavy_minus_sign: | N/A | Return to Pandora. | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | -| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC | -| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1680457607 | -| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1703239236 | -| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | -| `chapterSource` | *Optional* | :heavy_minus_sign: | N/A | media | -| `primaryExtraKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58684 | -| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | -| `grandparentRatingKey` | *Optional* | :heavy_minus_sign: | N/A | 66 | -| `grandparentGuid` | *Optional* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 | -| `grandparentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66 | -| `grandparentTitle` | *Optional* | :heavy_minus_sign: | N/A | Caprica | -| `grandparentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 | -| `grandparentArt` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 | -| `grandparentTheme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 | -| `media` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsMedia](../../models/operations/GetLibraryItemsMedia.md)> | :heavy_minus_sign: | N/A | [
{
"id": 119534,
"duration": 11558112,
"bitrate": 25025,
"width": 3840,
"height": 2072,
"aspectRatio": 1.85,
"audioChannels": 6,
"audioCodec": "eac3",
"videoCodec": "hevc",
"videoResolution": "4k",
"container": "mkv",
"videoFrameRate": "24p",
"videoProfile": "main 10",
"Part": [
{
"id": 119542,
"key": "/library/parts/119542/1680457526/file.mkv",
"duration": 11558112,
"file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv",
"size": 36158371307,
"container": "mkv",
"videoProfile": "main 10"
}
]
}
] | -| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsGenre](../../models/operations/GetLibraryItemsGenre.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "Adventure"
}
] | -| `country` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsCountry](../../models/operations/GetLibraryItemsCountry.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "United States of America"
}
] | -| `director` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsDirector](../../models/operations/GetLibraryItemsDirector.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "James Cameron"
}
] | -| `writer` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsWriter](../../models/operations/GetLibraryItemsWriter.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "James Cameron"
}
] | -| `role` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsRole](../../models/operations/GetLibraryItemsRole.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "Sigourney Weaver"
}
] | -| `titleSort` | *Optional* | :heavy_minus_sign: | N/A | Whale | -| `viewCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `lastViewedAt` | *Optional* | :heavy_minus_sign: | N/A | 1682752242 | -| `originalTitle` | *Optional* | :heavy_minus_sign: | N/A | 映画 ブラッククローバー 魔法帝の剣 | -| `viewOffset` | *Optional* | :heavy_minus_sign: | N/A | 5222500 | -| `skipCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `index` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `theme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 | -| `leafCount` | *Optional* | :heavy_minus_sign: | N/A | 14 | -| `viewedLeafCount` | *Optional* | :heavy_minus_sign: | N/A | 0 | -| `childCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `hasPremiumExtras` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `hasPremiumPrimaryExtra` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `parentRatingKey` | *Optional* | :heavy_minus_sign: | N/A | 66 | -| `parentGuid` | *Optional* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 | -| `parentStudio` | *Optional* | :heavy_minus_sign: | N/A | UCP | -| `parentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66 | -| `parentTitle` | *Optional* | :heavy_minus_sign: | N/A | Caprica | -| `parentIndex` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `parentYear` | *Optional* | :heavy_minus_sign: | N/A | 2010 | -| `parentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 | -| `parentTheme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 58683 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683 | +| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5d7768ba96b655001fdc0408 | +| `studio` | *Optional* | :heavy_minus_sign: | N/A | 20th Century Studios | +| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Avatar: The Way of Water | +| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | +| `summary` | *Optional* | :heavy_minus_sign: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. | +| `rating` | *Optional* | :heavy_minus_sign: | N/A | 7.6 | +| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 9.2 | +| `year` | *Optional* | :heavy_minus_sign: | N/A | 2022 | +| `tagline` | *Optional* | :heavy_minus_sign: | N/A | Return to Pandora. | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | +| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC | +| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1680457607 | +| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1703239236 | +| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `chapterSource` | *Optional* | :heavy_minus_sign: | N/A | media | +| `primaryExtraKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58684 | +| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | +| `grandparentRatingKey` | *Optional* | :heavy_minus_sign: | N/A | 66 | +| `grandparentGuid` | *Optional* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 | +| `grandparentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66 | +| `grandparentTitle` | *Optional* | :heavy_minus_sign: | N/A | Caprica | +| `grandparentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 | +| `grandparentArt` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 | +| `grandparentTheme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 | +| `media` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsMedia](../../models/operations/GetLibraryItemsMedia.md)> | :heavy_minus_sign: | N/A | | +| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsGenre](../../models/operations/GetLibraryItemsGenre.md)> | :heavy_minus_sign: | N/A | | +| `country` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsCountry](../../models/operations/GetLibraryItemsCountry.md)> | :heavy_minus_sign: | N/A | | +| `director` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsDirector](../../models/operations/GetLibraryItemsDirector.md)> | :heavy_minus_sign: | N/A | | +| `writer` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsWriter](../../models/operations/GetLibraryItemsWriter.md)> | :heavy_minus_sign: | N/A | | +| `role` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsRole](../../models/operations/GetLibraryItemsRole.md)> | :heavy_minus_sign: | N/A | | +| `titleSort` | *Optional* | :heavy_minus_sign: | N/A | Whale | +| `viewCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `lastViewedAt` | *Optional* | :heavy_minus_sign: | N/A | 1682752242 | +| `originalTitle` | *Optional* | :heavy_minus_sign: | N/A | 映画 ブラッククローバー 魔法帝の剣 | +| `viewOffset` | *Optional* | :heavy_minus_sign: | N/A | 5222500 | +| `skipCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `index` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `theme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 | +| `leafCount` | *Optional* | :heavy_minus_sign: | N/A | 14 | +| `viewedLeafCount` | *Optional* | :heavy_minus_sign: | N/A | 0 | +| `childCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `hasPremiumExtras` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `hasPremiumPrimaryExtra` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `parentRatingKey` | *Optional* | :heavy_minus_sign: | N/A | 66 | +| `parentGuid` | *Optional* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 | +| `parentStudio` | *Optional* | :heavy_minus_sign: | N/A | UCP | +| `parentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66 | +| `parentTitle` | *Optional* | :heavy_minus_sign: | N/A | Caprica | +| `parentIndex` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `parentYear` | *Optional* | :heavy_minus_sign: | N/A | 2010 | +| `parentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 | +| `parentTheme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsRequest.md b/docs/models/operations/GetLibraryItemsRequest.md index d0ae59d9..36636ee4 100644 --- a/docs/models/operations/GetLibraryItemsRequest.md +++ b/docs/models/operations/GetLibraryItemsRequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `sectionId` | *long* | :heavy_check_mark: | the Id of the library to query | -| `tag` | [lukehagar.plexapi.plexapi.models.operations.Tag](../../models/operations/Tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `sectionId` | *java.lang.Object* | :heavy_check_mark: | the Id of the library to query | | +| `tag` | [lukehagar.plexapi.plexapi.models.operations.Tag](../../models/operations/Tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | | +| `includeGuids` | *Optional* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryLibraryResponseBody.md b/docs/models/operations/GetLibraryLibraryResponseBody.md deleted file mode 100644 index f259a390..00000000 --- a/docs/models/operations/GetLibraryLibraryResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryLibraryResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryErrors](../../models/operations/GetLibraryErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryMediaContainer.md b/docs/models/operations/GetLibraryMediaContainer.md index 02a8dded..bf2ca438 100644 --- a/docs/models/operations/GetLibraryMediaContainer.md +++ b/docs/models/operations/GetLibraryMediaContainer.md @@ -3,20 +3,20 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 29 | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | false | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | -| `content` | *Optional* | :heavy_minus_sign: | N/A | secondary | -| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1701731894 | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie.png | -| `title1` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `viewGroup` | *Optional* | :heavy_minus_sign: | N/A | secondary | -| `viewMode` | *Optional* | :heavy_minus_sign: | N/A | 65592 | -| `directory` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryDirectory](../../models/operations/GetLibraryDirectory.md)> | :heavy_minus_sign: | N/A | [
{
"key": "search?type=1",
"title": "Search...",
"secondary": true,
"prompt": "Search Movies",
"search": true
}
] | -| `type` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryType](../../models/operations/GetLibraryType.md)> | :heavy_minus_sign: | N/A | [
{
"key": "/library/sections/1/all?type=1",
"type": "movie",
"title": "Movies",
"active": false,
"Filter": [
{
"filter": "genre",
"filterType": "string",
"key": "/library/sections/1/genre",
"title": "Genre",
"type": "filter"
},
{
"filter": "year",
"filterType": "integer",
"key": "/library/sections/1/year",
"title": "Year",
"type": "filter"
},
{
"filter": "decade",
"filterType": "integer",
"key": "/library/sections/1/decade",
"title": "Decade",
"type": "filter"
},
{
"filter": "contentRating",
"filterType": "string",
"key": "/library/sections/1/contentRating",
"title": "Content Rating",
"type": "filter"
},
{
"filter": "collection",
"filterType": "string",
"key": "/library/sections/1/collection",
"title": "Collection",
"type": "filter"
},
{
"filter": "director",
"filterType": "string",
"key": "/library/sections/1/director",
"title": "Director",
"type": "filter"
},
{
"filter": "actor",
"filterType": "string",
"key": "/library/sections/1/actor",
"title": "Actor",
"type": "filter"
},
{
"filter": "writer",
"filterType": "string",
"key": "/library/sections/1/writer",
"title": "Writer",
"type": "filter"
},
{
"filter": "producer",
"filterType": "string",
"key": "/library/sections/1/producer",
"title": "Producer",
"type": "filter"
},
{
"filter": "country",
"filterType": "string",
"key": "/library/sections/1/country",
"title": "Country",
"type": "filter"
},
{
"filter": "studio",
"filterType": "string",
"key": "/library/sections/1/studio",
"title": "Studio",
"type": "filter"
},
{
"filter": "resolution",
"filterType": "string",
"key": "/library/sections/1/resolution",
"title": "Resolution",
"type": "filter"
},
{
"filter": "hdr",
"filterType": "boolean",
"key": "/library/sections/1/hdr",
"title": "HDR",
"type": "filter"
},
{
"filter": "unwatched",
"filterType": "boolean",
"key": "/library/sections/1/unwatched",
"title": "Unplayed",
"type": "filter"
},
{
"filter": "inProgress",
"filterType": "boolean",
"key": "/library/sections/1/inProgress",
"title": "In Progress",
"type": "filter"
},
{
"filter": "unmatched",
"filterType": "boolean",
"key": "/library/sections/1/unmatched",
"title": "Unmatched",
"type": "filter"
},
{
"filter": "audioLanguage",
"filterType": "string",
"key": "/library/sections/1/audioLanguage",
"title": "Audio Language",
"type": "filter"
},
{
"filter": "subtitleLanguage",
"filterType": "string",
"key": "/library/sections/1/subtitleLanguage",
"title": "Subtitle Language",
"type": "filter"
},
{
"filter": "editionTitle",
"filterType": "string",
"key": "/library/sections/1/editionTitle",
"title": "Edition",
"type": "filter"
},
{
"filter": "label",
"filterType": "string",
"key": "/library/sections/1/label",
"title": "Labels",
"type": "filter"
}
],
"Sort": [
{
"default": "asc",
"defaultDirection": "asc",
"descKey": "titleSort:desc",
"firstCharacterKey": "/library/sections/1/firstCharacter",
"key": "titleSort",
"title": "Title"
},
{
"defaultDirection": "desc",
"descKey": "originallyAvailableAt:desc",
"key": "originallyAvailableAt",
"title": "Release Date"
},
{
"defaultDirection": "desc",
"descKey": "rating:desc",
"key": "rating",
"title": "Critic Rating"
},
{
"defaultDirection": "desc",
"descKey": "audienceRating:desc",
"key": "audienceRating",
"title": "Audience Rating"
},
{
"defaultDirection": "desc",
"descKey": "duration:desc",
"key": "duration",
"title": "Duration"
},
{
"defaultDirection": "desc",
"descKey": "addedAt:desc",
"key": "addedAt",
"title": "Date Added"
},
{
"defaultDirection": "desc",
"descKey": "lastViewedAt:desc",
"key": "lastViewedAt",
"title": "Date Viewed"
},
{
"defaultDirection": "asc",
"descKey": "mediaHeight:desc",
"key": "mediaHeight",
"title": "Resolution"
},
{
"defaultDirection": "desc",
"descKey": "random:desc",
"key": "random",
"title": "Randomly"
}
],
"Field": [
{
"key": "title",
"title": "Title",
"type": "string"
},
{
"key": "studio",
"title": "Studio",
"type": "string"
},
{
"key": "userRating",
"subType": "rating",
"title": "Rating",
"type": "integer"
},
{
"key": "contentRating",
"title": "Content Rating",
"type": "tag"
},
{
"key": "year",
"subType": "year",
"title": "Year",
"type": "integer"
},
{
"key": "decade",
"subType": "decade",
"title": "Decade",
"type": "integer"
},
{
"key": "originallyAvailableAt",
"title": "Release Date",
"type": "date"
},
{
"key": "duration",
"subType": "duration",
"title": "Duration",
"type": "integer"
},
{
"key": "unmatched",
"title": "Unmatched",
"type": "boolean"
},
{
"key": "duplicate",
"title": "Duplicate",
"type": "boolean"
},
{
"key": "genre",
"title": "Genre",
"type": "tag"
},
{
"key": "collection",
"title": "Collection",
"type": "tag"
},
{
"key": "director",
"title": "Director",
"type": "tag"
},
{
"key": "writer",
"title": "Writer",
"type": "tag"
},
{
"key": "producer",
"title": "Producer",
"type": "tag"
},
{
"key": "actor",
"title": "Actor",
"type": "tag"
},
{
"key": "country",
"title": "Country",
"type": "tag"
},
{
"key": "addedAt",
"title": "Date Added",
"type": "date"
},
{
"key": "viewCount",
"title": "Plays",
"type": "integer"
},
{
"key": "lastViewedAt",
"title": "Last Played",
"type": "date"
},
{
"key": "unwatched",
"title": "Unplayed",
"type": "boolean"
},
{
"key": "resolution",
"title": "Resolution",
"type": "resolution"
},
{
"key": "hdr",
"subType": "hdr",
"title": "HDR",
"type": "boolean"
},
{
"key": "mediaSize",
"subType": "fileSize",
"title": "File Size",
"type": "integer"
},
{
"key": "mediaBitrate",
"subType": "bitrate",
"title": "Bitrate",
"type": "integer"
},
{
"key": "subtitleLanguage",
"title": "Subtitle Language",
"type": "subtitleLanguage"
},
{
"key": "audioLanguage",
"title": "Audio Language",
"type": "audioLanguage"
},
{
"key": "inProgress",
"title": "In Progress",
"type": "boolean"
},
{
"key": "trash",
"title": "Trash",
"type": "boolean"
},
{
"key": "editionTitle",
"title": "Edition",
"type": "string"
},
{
"key": "label",
"title": "Label",
"type": "tag"
}
]
}
] | -| `fieldType` | List<[lukehagar.plexapi.plexapi.models.operations.FieldType](../../models/operations/FieldType.md)> | :heavy_minus_sign: | N/A | [
{
"type": "resolution",
"Operator": [
{
"key": "=",
"title": "is"
}
]
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 29 | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | false | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | +| `content` | *Optional* | :heavy_minus_sign: | N/A | secondary | +| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1701731894 | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie.png | +| `title1` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `viewGroup` | *Optional* | :heavy_minus_sign: | N/A | secondary | +| `viewMode` | *Optional* | :heavy_minus_sign: | N/A | 65592 | +| `directory` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryDirectory](../../models/operations/GetLibraryDirectory.md)> | :heavy_minus_sign: | N/A | | +| `type` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryType](../../models/operations/GetLibraryType.md)> | :heavy_minus_sign: | N/A | | +| `fieldType` | List<[lukehagar.plexapi.plexapi.models.operations.FieldType](../../models/operations/FieldType.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryResponse.md b/docs/models/operations/GetLibraryResponse.md index 36f19dc9..e433df3b 100644 --- a/docs/models/operations/GetLibraryResponse.md +++ b/docs/models/operations/GetLibraryResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetLibraryResponseBody.md) | :heavy_minus_sign: | The details of the library | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetLibraryLibraryResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetLibraryResponseBody.md) | :heavy_minus_sign: | The details of the library | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryType.md b/docs/models/operations/GetLibraryType.md index 8b019fd3..495b89ad 100644 --- a/docs/models/operations/GetLibraryType.md +++ b/docs/models/operations/GetLibraryType.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1/all?type=1 | -| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `active` | *Optional* | :heavy_minus_sign: | N/A | false | -| `filter` | List<[lukehagar.plexapi.plexapi.models.operations.Filter](../../models/operations/Filter.md)> | :heavy_minus_sign: | N/A | [
{
"filter": "label",
"filterType": "string",
"key": "/library/sections/1/label",
"title": "Labels",
"type": "filter"
}
] | -| `sort` | List<[lukehagar.plexapi.plexapi.models.operations.Sort](../../models/operations/Sort.md)> | :heavy_minus_sign: | N/A | [
{
"default": "asc",
"defaultDirection": "desc",
"descKey": "random:desc",
"firstCharacterKey": "/library/sections/1/firstCharacter",
"key": "random",
"title": "Randomly"
}
] | -| `field` | List<[lukehagar.plexapi.plexapi.models.operations.Field](../../models/operations/Field.md)> | :heavy_minus_sign: | N/A | [
{
"key": "label",
"title": "Label",
"type": "tag",
"subType": "bitrate"
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1/all?type=1 | +| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `active` | *Optional* | :heavy_minus_sign: | N/A | false | +| `filter` | List<[lukehagar.plexapi.plexapi.models.operations.GetLibraryFilter](../../models/operations/GetLibraryFilter.md)> | :heavy_minus_sign: | N/A | | +| `sort` | List<[lukehagar.plexapi.plexapi.models.operations.Sort](../../models/operations/Sort.md)> | :heavy_minus_sign: | N/A | | +| `field` | List<[lukehagar.plexapi.plexapi.models.operations.Field](../../models/operations/Field.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetMetadataChildrenLibraryResponseBody.md b/docs/models/operations/GetMetadataChildrenLibraryResponseBody.md deleted file mode 100644 index d8721038..00000000 --- a/docs/models/operations/GetMetadataChildrenLibraryResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMetadataChildrenLibraryResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenErrors](../../models/operations/GetMetadataChildrenErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetMetadataChildrenMediaContainer.md b/docs/models/operations/GetMetadataChildrenMediaContainer.md index 5fc691c7..f3d457ad 100644 --- a/docs/models/operations/GetMetadataChildrenMediaContainer.md +++ b/docs/models/operations/GetMetadataChildrenMediaContainer.md @@ -3,28 +3,28 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 3 | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/30072/art/1705739923 | -| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `key` | *Optional* | :heavy_minus_sign: | N/A | 30072 | -| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 2 | -| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | TV Shows | -| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | 4bb2521c-8ba9-459b-aaee-8ab8bc35eabd | -| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1701731894 | -| `nocache` | *Optional* | :heavy_minus_sign: | N/A | true | -| `parentIndex` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `parentTitle` | *Optional* | :heavy_minus_sign: | N/A | Reacher | -| `parentYear` | *Optional* | :heavy_minus_sign: | N/A | 2022 | -| `summary` | *Optional* | :heavy_minus_sign: | N/A | When retired Military Police Officer Jack Reacher is arrested for a murder he did not commit, he finds himself in the middle of a deadly conspiracy full of dirty cops, shady businessmen, and scheming politicians. With nothing but his wits, he must figure out what is happening in Margrave, Georgia. | -| `theme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/30072/theme/1705739923 | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/30072/thumb/1705739923 | -| `title1` | *Optional* | :heavy_minus_sign: | N/A | TV Shows | -| `title2` | *Optional* | :heavy_minus_sign: | N/A | Reacher | -| `viewGroup` | *Optional* | :heavy_minus_sign: | N/A | season | -| `viewMode` | *Optional* | :heavy_minus_sign: | N/A | 65593 | -| `directory` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenDirectory](../../models/operations/GetMetadataChildrenDirectory.md)> | :heavy_minus_sign: | N/A | [
{
"leafCount": 16,
"thumb": "/library/metadata/30072/thumb/1705739923",
"viewedLeafCount": 16,
"key": "/library/metadata/30072/allLeaves",
"title": "All episodes"
}
] | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenMetadata](../../models/operations/GetMetadataChildrenMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"ratingKey": "66488",
"key": "/library/metadata/66488/children",
"parentRatingKey": "30072",
"guid": "plex://season/652aea6549508477c34c6000",
"parentGuid": "plex://show/5d9c09190aaccd001f8f42f0",
"parentStudio": "Amazon Studios",
"type": "season",
"title": "Season 2",
"parentKey": "/library/metadata/30072",
"parentTitle": "Reacher",
"summary": "Based on\"Bad Luck and Trouble,\" when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mind—revenge.",
"index": 2,
"parentIndex": 1,
"viewCount": 11,
"lastViewedAt": 1705646565,
"parentYear": 2022,
"thumb": "/library/metadata/66488/thumb/1703065033",
"art": "/library/metadata/30072/art/1705739923",
"parentThumb": "/library/metadata/30072/thumb/1705739923",
"parentTheme": "/library/metadata/30072/theme/1705739923",
"leafCount": 8,
"viewedLeafCount": 8,
"addedAt": 1702602021,
"updatedAt": 1703065033,
"userRating": 9,
"skipCount": 1,
"lastRatedAt": 1703881224
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 3 | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/30072/art/1705739923 | +| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `key` | *Optional* | :heavy_minus_sign: | N/A | 30072 | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 2 | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | TV Shows | +| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | 4bb2521c-8ba9-459b-aaee-8ab8bc35eabd | +| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1701731894 | +| `nocache` | *Optional* | :heavy_minus_sign: | N/A | true | +| `parentIndex` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `parentTitle` | *Optional* | :heavy_minus_sign: | N/A | Reacher | +| `parentYear` | *Optional* | :heavy_minus_sign: | N/A | 2022 | +| `summary` | *Optional* | :heavy_minus_sign: | N/A | When retired Military Police Officer Jack Reacher is arrested for a murder he did not commit, he finds himself in the middle of a deadly conspiracy full of dirty cops, shady businessmen, and scheming politicians. With nothing but his wits, he must figure out what is happening in Margrave, Georgia. | +| `theme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/30072/theme/1705739923 | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/30072/thumb/1705739923 | +| `title1` | *Optional* | :heavy_minus_sign: | N/A | TV Shows | +| `title2` | *Optional* | :heavy_minus_sign: | N/A | Reacher | +| `viewGroup` | *Optional* | :heavy_minus_sign: | N/A | season | +| `viewMode` | *Optional* | :heavy_minus_sign: | N/A | 65593 | +| `directory` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenDirectory](../../models/operations/GetMetadataChildrenDirectory.md)> | :heavy_minus_sign: | N/A | [
{
"leafCount": 16,
"thumb": "/library/metadata/30072/thumb/1705739923",
"viewedLeafCount": 16,
"key": "/library/metadata/30072/allLeaves",
"title": "All episodes"
}
] | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenMetadata](../../models/operations/GetMetadataChildrenMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetMetadataChildrenRequest.md b/docs/models/operations/GetMetadataChildrenRequest.md index 3b81cc61..5de99e80 100644 --- a/docs/models/operations/GetMetadataChildrenRequest.md +++ b/docs/models/operations/GetMetadataChildrenRequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ratingKey` | *double* | :heavy_check_mark: | the id of the library item to return the children of. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ratingKey` | *double* | :heavy_check_mark: | the id of the library item to return the children of. | +| `includeElements` | *Optional* | :heavy_minus_sign: | Adds additional elements to the response. Supported types are (Stream)
| \ No newline at end of file diff --git a/docs/models/operations/GetMetadataChildrenResponse.md b/docs/models/operations/GetMetadataChildrenResponse.md index 3dfbdd21..ca4297f5 100644 --- a/docs/models/operations/GetMetadataChildrenResponse.md +++ b/docs/models/operations/GetMetadataChildrenResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetMetadataChildrenResponseBody.md) | :heavy_minus_sign: | The children of the library item. | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetMetadataChildrenLibraryResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetMetadataLibraryResponseBody.md b/docs/models/operations/GetMetadataLibraryResponseBody.md deleted file mode 100644 index 98f22aa5..00000000 --- a/docs/models/operations/GetMetadataLibraryResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMetadataLibraryResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataErrors](../../models/operations/GetMetadataErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetMetadataMedia.md b/docs/models/operations/GetMetadataMedia.md index 2ff958eb..c6e96b04 100644 --- a/docs/models/operations/GetMetadataMedia.md +++ b/docs/models/operations/GetMetadataMedia.md @@ -3,22 +3,22 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `id` | *Optional* | :heavy_minus_sign: | N/A | 15 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141417 | -| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 2278 | -| `width` | *Optional* | :heavy_minus_sign: | N/A | 1920 | -| `height` | *Optional* | :heavy_minus_sign: | N/A | 814 | -| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 2.35 | -| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 2 | -| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | aac | -| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | h264 | -| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 1080 | -| `container` | *Optional* | :heavy_minus_sign: | N/A | mp4 | -| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | -| `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | 0 | -| `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | lc | -| `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | -| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | high | -| `part` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataPart](../../models/operations/GetMetadataPart.md)> | :heavy_minus_sign: | N/A | [
{
"id": 15,
"key": "/library/parts/15/1705637151/file.mp4",
"duration": 141417,
"file": "/movies/Serenity (2005)/Serenity (2005).mp4",
"size": 40271948,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": false,
"videoProfile": "high",
"Stream": [
{
"id": 30,
"streamType": 1,
"default": true,
"codec": "h264",
"index": 1,
"bitrate": 2160,
"bitDepth": 8,
"chromaLocation": "left",
"chromaSubsampling": 14520,
"codedHeight": 816,
"codedWidth": 1920,
"colorPrimaries": "bt709",
"colorRange": "tv",
"colorSpace": "bt709",
"colorTrc": "bt709",
"frameRate": 24,
"hasScalingMatrix": false,
"height": 814,
"level": 40,
"profile": "high",
"refFrames": 4,
"scanType": "progressive",
"streamIdentifier": "2",
"width": 1920,
"displayTitle": "1080p (H.264)",
"extendedDisplayTitle": "1080p (H.264)"
},
{
"id": 29,
"streamType": 2,
"selected": true,
"default": true,
"codec": "aac",
"index": 0,
"channels": 2,
"bitrate": 128,
"language": "English",
"languageTag": "en",
"languageCode": "eng",
"profile": "lc",
"samplingRate": 44100,
"streamIdentifier": "1",
"displayTitle": "English (AAC Stereo)",
"extendedDisplayTitle": "English (AAC Stereo)"
}
]
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 15 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141417 | +| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 2278 | +| `width` | *Optional* | :heavy_minus_sign: | N/A | 1920 | +| `height` | *Optional* | :heavy_minus_sign: | N/A | 814 | +| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 2.35 | +| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 2 | +| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | aac | +| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | h264 | +| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 1080 | +| `container` | *Optional* | :heavy_minus_sign: | N/A | mp4 | +| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | +| `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | 0 | +| `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | lc | +| `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | high | +| `part` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataPart](../../models/operations/GetMetadataPart.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetMetadataMediaContainer.md b/docs/models/operations/GetMetadataMediaContainer.md index 3ac1bfa1..dd2dcdc3 100644 --- a/docs/models/operations/GetMetadataMediaContainer.md +++ b/docs/models/operations/GetMetadataMediaContainer.md @@ -3,14 +3,14 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | -| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | cfc899d7-3000-46f6-8489-b9592714ada5 | -| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1698860922 | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataMetadata](../../models/operations/GetMetadataMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"ratingKey": "17",
"key": "/library/metadata/17",
"guid": "plex://movie/5d77683f6f4521001ea9dc53",
"studio": "Universal Pictures",
"type": "movie",
"title": "Serenity",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "PG-13",
"summary": "Serenity continues the story of the TV series it was based upon (\"Firefly\"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job.",
"rating": 8.2,
"audienceRating": 9.1,
"year": 2005,
"tagline": "They aim to misbehave.",
"thumb": "/library/metadata/17/thumb/1705637165",
"art": "/library/metadata/17/art/1705637165",
"duration": 141417,
"originallyAvailableAt": "2005-09-29T00:00:00Z",
"addedAt": 1705637164,
"updatedAt": 1705637165,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"hasPremiumPrimaryExtra": "1",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 15,
"duration": 141417,
"bitrate": 2278,
"width": 1920,
"height": 814,
"aspectRatio": 2.35,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 0,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 15,
"key": "/library/parts/15/1705637151/file.mp4",
"duration": 141417,
"file": "/movies/Serenity (2005)/Serenity (2005).mp4",
"size": 40271948,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": false,
"videoProfile": "high",
"Stream": [
{
"id": 30,
"streamType": 1,
"default": true,
"codec": "h264",
"index": 1,
"bitrate": 2160,
"bitDepth": 8,
"chromaLocation": "left",
"chromaSubsampling": 14520,
"codedHeight": 816,
"codedWidth": 1920,
"colorPrimaries": "bt709",
"colorRange": "tv",
"colorSpace": "bt709",
"colorTrc": "bt709",
"frameRate": 24,
"hasScalingMatrix": false,
"height": 814,
"level": 40,
"profile": "high",
"refFrames": 4,
"scanType": "progressive",
"streamIdentifier": "2",
"width": 1920,
"displayTitle": "1080p (H.264)",
"extendedDisplayTitle": "1080p (H.264)"
},
{
"id": 29,
"streamType": 2,
"selected": true,
"default": true,
"codec": "aac",
"index": 0,
"channels": 2,
"bitrate": 128,
"language": "English",
"languageTag": "en",
"languageCode": "eng",
"profile": "lc",
"samplingRate": 44100,
"streamIdentifier": "1",
"displayTitle": "English (AAC Stereo)",
"extendedDisplayTitle": "English (AAC Stereo)"
}
]
}
]
}
],
"Genre": [
{
"id": 5,
"filter": "genre=5",
"tag": "Science Fiction"
}
],
"Country": [
{
"id": 116,
"filter": "country=116",
"tag": "United States of America"
}
],
"Guid": [
{
"id": "imdb://tt0379786"
}
],
"Rating": [
{
"image": "imdb://image.rating",
"value": 7.8,
"type": "audience"
}
],
"Director": [
{
"id": 130,
"filter": "director=130",
"tag": "Joss Whedon",
"tagKey": "5d776828880197001ec90e8f",
"thumb": "https://metadata-static.plex.tv/people/5d776828880197001ec90e8f.jpg"
}
],
"Writer": [
{
"id": 132,
"filter": "writer=132",
"tag": "Joss Whedon",
"tagKey": "5d776828880197001ec90e8f",
"thumb": "https://metadata-static.plex.tv/people/5d776828880197001ec90e8f.jpg"
}
],
"Role": [
{
"id": 8,
"filter": "actor=8",
"tag": "Nathan Fillion",
"tagKey": "5d7768286f4521001ea9945c",
"role": "Malcolm \"Mal\" Reynolds",
"thumb": "https://metadata-static.plex.tv/4/people/4a2890ca346eb832500b1ed0add89d5e.jpg"
}
],
"Producer": [
{
"id": 221,
"filter": "producer=221",
"tag": "Barry Mendel",
"tagKey": "5d776826961905001eb90e2b",
"thumb": "https://metadata-static.plex.tv/8/people/87877371326a964634d18556d94547e1.jpg"
}
]
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | +| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | cfc899d7-3000-46f6-8489-b9592714ada5 | +| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1698860922 | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataMetadata](../../models/operations/GetMetadataMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetMetadataMetadata.md b/docs/models/operations/GetMetadataMetadata.md index 8f75b12c..148f8ba7 100644 --- a/docs/models/operations/GetMetadataMetadata.md +++ b/docs/models/operations/GetMetadataMetadata.md @@ -3,38 +3,38 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 17 | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17 | -| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5d77683f6f4521001ea9dc53 | -| `studio` | *Optional* | :heavy_minus_sign: | N/A | Universal Pictures | -| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Serenity | -| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `librarySectionKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1 | -| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | -| `summary` | *Optional* | :heavy_minus_sign: | N/A | Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job. | -| `rating` | *Optional* | :heavy_minus_sign: | N/A | 8.2 | -| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 9.1 | -| `year` | *Optional* | :heavy_minus_sign: | N/A | 2005 | -| `tagline` | *Optional* | :heavy_minus_sign: | N/A | They aim to misbehave. | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17/thumb/1705637165 | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17/art/1705637165 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141417 | -| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2005-09-29 00:00:00 +0000 UTC | -| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705637164 | -| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705637165 | -| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | -| `hasPremiumPrimaryExtra` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | -| `media` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataMedia](../../models/operations/GetMetadataMedia.md)> | :heavy_minus_sign: | N/A | [
{
"id": 15,
"duration": 141417,
"bitrate": 2278,
"width": 1920,
"height": 814,
"aspectRatio": 2.35,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 0,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 15,
"key": "/library/parts/15/1705637151/file.mp4",
"duration": 141417,
"file": "/movies/Serenity (2005)/Serenity (2005).mp4",
"size": 40271948,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": false,
"videoProfile": "high",
"Stream": [
{
"id": 30,
"streamType": 1,
"default": true,
"codec": "h264",
"index": 1,
"bitrate": 2160,
"bitDepth": 8,
"chromaLocation": "left",
"chromaSubsampling": 14520,
"codedHeight": 816,
"codedWidth": 1920,
"colorPrimaries": "bt709",
"colorRange": "tv",
"colorSpace": "bt709",
"colorTrc": "bt709",
"frameRate": 24,
"hasScalingMatrix": false,
"height": 814,
"level": 40,
"profile": "high",
"refFrames": 4,
"scanType": "progressive",
"streamIdentifier": "2",
"width": 1920,
"displayTitle": "1080p (H.264)",
"extendedDisplayTitle": "1080p (H.264)"
},
{
"id": 29,
"streamType": 2,
"selected": true,
"default": true,
"codec": "aac",
"index": 0,
"channels": 2,
"bitrate": 128,
"language": "English",
"languageTag": "en",
"languageCode": "eng",
"profile": "lc",
"samplingRate": 44100,
"streamIdentifier": "1",
"displayTitle": "English (AAC Stereo)",
"extendedDisplayTitle": "English (AAC Stereo)"
}
]
}
]
}
] | -| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataGenre](../../models/operations/GetMetadataGenre.md)> | :heavy_minus_sign: | N/A | [
{
"id": 184,
"filter": "genre=184",
"tag": "Thriller"
}
] | -| `country` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataCountry](../../models/operations/GetMetadataCountry.md)> | :heavy_minus_sign: | N/A | [
{
"id": 116,
"filter": "country=116",
"tag": "United States of America"
}
] | -| `guids` | List<[lukehagar.plexapi.plexapi.models.operations.Guids](../../models/operations/Guids.md)> | :heavy_minus_sign: | N/A | [
{
"id": "tvdb://2337"
}
] | -| `ratings` | List<[lukehagar.plexapi.plexapi.models.operations.Ratings](../../models/operations/Ratings.md)> | :heavy_minus_sign: | N/A | [
{
"image": "themoviedb://image.rating",
"value": 7.4,
"type": "audience"
}
] | -| `director` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataDirector](../../models/operations/GetMetadataDirector.md)> | :heavy_minus_sign: | N/A | [
{
"id": 130,
"filter": "director=130",
"tag": "Joss Whedon",
"tagKey": "5d776828880197001ec90e8f",
"thumb": "https://metadata-static.plex.tv/people/5d776828880197001ec90e8f.jpg"
}
] | -| `writer` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataWriter](../../models/operations/GetMetadataWriter.md)> | :heavy_minus_sign: | N/A | [
{
"id": 132,
"filter": "writer=132",
"tag": "Joss Whedon",
"tagKey": "5d776828880197001ec90e8f",
"thumb": "https://metadata-static.plex.tv/people/5d776828880197001ec90e8f.jpg"
}
] | -| `role` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataRole](../../models/operations/GetMetadataRole.md)> | :heavy_minus_sign: | N/A | [
{
"id": 220,
"filter": "actor=220",
"tag": "Dennis Keiffer",
"tagKey": "5d77683554f42c001f8c4708",
"role": "Bar Guy (uncredited)",
"thumb": "https://metadata-static.plex.tv/6/people/648e9a7ea1d537bccfcd7615134b78ce.jpg"
}
] | -| `producer` | List<[lukehagar.plexapi.plexapi.models.operations.Producer](../../models/operations/Producer.md)> | :heavy_minus_sign: | N/A | [
{
"id": 221,
"filter": "producer=221",
"tag": "Barry Mendel",
"tagKey": "5d776826961905001eb90e2b",
"thumb": "https://metadata-static.plex.tv/8/people/87877371326a964634d18556d94547e1.jpg"
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 17 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17 | +| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5d77683f6f4521001ea9dc53 | +| `studio` | *Optional* | :heavy_minus_sign: | N/A | Universal Pictures | +| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Serenity | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1 | +| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | +| `summary` | *Optional* | :heavy_minus_sign: | N/A | Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job. | +| `rating` | *Optional* | :heavy_minus_sign: | N/A | 8.2 | +| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 9.1 | +| `year` | *Optional* | :heavy_minus_sign: | N/A | 2005 | +| `tagline` | *Optional* | :heavy_minus_sign: | N/A | They aim to misbehave. | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17/thumb/1705637165 | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17/art/1705637165 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141417 | +| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2005-09-29 00:00:00 +0000 UTC | +| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705637164 | +| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705637165 | +| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `hasPremiumPrimaryExtra` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | +| `media` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataMedia](../../models/operations/GetMetadataMedia.md)> | :heavy_minus_sign: | N/A | | +| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataGenre](../../models/operations/GetMetadataGenre.md)> | :heavy_minus_sign: | N/A | | +| `country` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataCountry](../../models/operations/GetMetadataCountry.md)> | :heavy_minus_sign: | N/A | | +| `guids` | List<[lukehagar.plexapi.plexapi.models.operations.Guids](../../models/operations/Guids.md)> | :heavy_minus_sign: | N/A | | +| `ratings` | List<[lukehagar.plexapi.plexapi.models.operations.Ratings](../../models/operations/Ratings.md)> | :heavy_minus_sign: | N/A | | +| `director` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataDirector](../../models/operations/GetMetadataDirector.md)> | :heavy_minus_sign: | N/A | | +| `writer` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataWriter](../../models/operations/GetMetadataWriter.md)> | :heavy_minus_sign: | N/A | | +| `role` | List<[lukehagar.plexapi.plexapi.models.operations.GetMetadataRole](../../models/operations/GetMetadataRole.md)> | :heavy_minus_sign: | N/A | | +| `producer` | List<[lukehagar.plexapi.plexapi.models.operations.Producer](../../models/operations/Producer.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetMetadataPart.md b/docs/models/operations/GetMetadataPart.md index b7f02f48..53f9ed88 100644 --- a/docs/models/operations/GetMetadataPart.md +++ b/docs/models/operations/GetMetadataPart.md @@ -3,16 +3,16 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *Optional* | :heavy_minus_sign: | N/A | 15 | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/parts/15/1705637151/file.mp4 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141417 | -| `file` | *Optional* | :heavy_minus_sign: | N/A | /movies/Serenity (2005)/Serenity (2005).mp4 | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 40271948 | -| `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | lc | -| `container` | *Optional* | :heavy_minus_sign: | N/A | mp4 | -| `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | -| `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | false | -| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | high | -| `stream` | List<[lukehagar.plexapi.plexapi.models.operations.Stream](../../models/operations/Stream.md)> | :heavy_minus_sign: | N/A | [
{
"id": 29,
"streamType": 2,
"default": true,
"codec": "aac",
"index": 0,
"bitrate": 128,
"bitDepth": 8,
"chromaLocation": "left",
"chromaSubsampling": 14520,
"codedHeight": 816,
"codedWidth": 1920,
"colorPrimaries": "bt709",
"colorRange": "tv",
"colorSpace": "bt709",
"colorTrc": "bt709",
"frameRate": 24,
"hasScalingMatrix": false,
"height": 814,
"level": 40,
"profile": "lc",
"refFrames": 4,
"scanType": "progressive",
"streamIdentifier": "1",
"width": 1920,
"displayTitle": "English (AAC Stereo)",
"extendedDisplayTitle": "English (AAC Stereo)",
"selected": true,
"channels": 2,
"language": "English",
"languageTag": "en",
"languageCode": "eng",
"samplingRate": 44100
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 15 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/parts/15/1705637151/file.mp4 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141417 | +| `file` | *Optional* | :heavy_minus_sign: | N/A | /movies/Serenity (2005)/Serenity (2005).mp4 | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 40271948 | +| `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | lc | +| `container` | *Optional* | :heavy_minus_sign: | N/A | mp4 | +| `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | +| `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | false | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | high | +| `stream` | List<[lukehagar.plexapi.plexapi.models.operations.Stream](../../models/operations/Stream.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetMetadataResponse.md b/docs/models/operations/GetMetadataResponse.md index 3e9fedbc..6c26794f 100644 --- a/docs/models/operations/GetMetadataResponse.md +++ b/docs/models/operations/GetMetadataResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetMetadataResponseBody.md) | :heavy_minus_sign: | The metadata of the library item. | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetMetadataLibraryResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetMetadataResponseBody.md) | :heavy_minus_sign: | The metadata 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 a680ff8a..352f9927 100644 --- a/docs/models/operations/GetMyPlexAccountResponse.md +++ b/docs/models/operations/GetMyPlexAccountResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetMyPlexAccountResponseBody.md) | :heavy_minus_sign: | MyPlex Account | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetMyPlexAccountServerResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetOnDeckLibraryResponseBody.md b/docs/models/operations/GetOnDeckLibraryResponseBody.md deleted file mode 100644 index 38fbc488..00000000 --- a/docs/models/operations/GetOnDeckLibraryResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetOnDeckLibraryResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetOnDeckErrors](../../models/operations/GetOnDeckErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetOnDeckResponse.md b/docs/models/operations/GetOnDeckResponse.md index df9df3b4..f0adb313 100644 --- a/docs/models/operations/GetOnDeckResponse.md +++ b/docs/models/operations/GetOnDeckResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetOnDeckResponseBody.md) | :heavy_minus_sign: | The on Deck content | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetOnDeckLibraryResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetOnDeckResponseBody.md) | :heavy_minus_sign: | The on Deck content | \ No newline at end of file diff --git a/docs/models/operations/GetPinPlexResponseBody.md b/docs/models/operations/GetPinPlexResponseBody.md deleted file mode 100644 index 351c8cee..00000000 --- a/docs/models/operations/GetPinPlexResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPinPlexResponseBody - -X-Plex-Client-Identifier is missing - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetPinErrors](../../models/operations/GetPinErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetPinRequest.md b/docs/models/operations/GetPinRequest.md index 3d0d2c81..9cff2227 100644 --- a/docs/models/operations/GetPinRequest.md +++ b/docs/models/operations/GetPinRequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `strong` | *Optional* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| -| `xPlexClientIdentifier` | *String* | :heavy_check_mark: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `strong` | *Optional* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | +| `xPlexClientIdentifier` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| Postman | +| `xPlexProduct` | *String* | :heavy_check_mark: | Product name of the application shown in the list of devices
| Postman | \ No newline at end of file diff --git a/docs/models/operations/GetPinResponse.md b/docs/models/operations/GetPinResponse.md index 706e465e..21f2b763 100644 --- a/docs/models/operations/GetPinResponse.md +++ b/docs/models/operations/GetPinResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetPinResponseBody.md) | :heavy_minus_sign: | The Pin | -| `fourHundredApplicationJsonObject` | [Optional](../../models/operations/GetPinPlexResponseBody.md) | :heavy_minus_sign: | X-Plex-Client-Identifier is missing | \ 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/GetPinResponseBody.md) | :heavy_minus_sign: | The Pin | \ No newline at end of file diff --git a/docs/models/operations/GetPinResponseBody.md b/docs/models/operations/GetPinResponseBody.md index c7a40126..b1eea52c 100644 --- a/docs/models/operations/GetPinResponseBody.md +++ b/docs/models/operations/GetPinResponseBody.md @@ -18,4 +18,4 @@ The Pin | `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | 2023-04-12 17:00:03 +0000 UTC | | `expiresAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | 2023-04-12 17:30:03 +0000 UTC | | `authToken` | *Optional* | :heavy_minus_sign: | N/A | | -| `newRegistration` | *Optional* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `newRegistration` | *JsonNullable* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistContentsMedia.md b/docs/models/operations/GetPlaylistContentsMedia.md index ca1b0b57..9762f6b4 100644 --- a/docs/models/operations/GetPlaylistContentsMedia.md +++ b/docs/models/operations/GetPlaylistContentsMedia.md @@ -3,22 +3,22 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *Optional* | :heavy_minus_sign: | N/A | 15 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141416 | -| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 2273 | -| `width` | *Optional* | :heavy_minus_sign: | N/A | 1920 | -| `height` | *Optional* | :heavy_minus_sign: | N/A | 814 | -| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 2.35 | -| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 2 | -| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | aac | -| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | h264 | -| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 1080 | -| `container` | *Optional* | :heavy_minus_sign: | N/A | mp4 | -| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | -| `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | 0 | -| `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | lc | -| `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | -| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | high | -| `part` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsPart](../../models/operations/GetPlaylistContentsPart.md)> | :heavy_minus_sign: | N/A | [
{
"id": 15,
"key": "/library/parts/15/1705637151/file.mp4",
"duration": 141416,
"file": "/movies/Serenity (2005)/Serenity (2005).mp4",
"size": 40271948,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": false,
"videoProfile": "high"
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 15 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141416 | +| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 2273 | +| `width` | *Optional* | :heavy_minus_sign: | N/A | 1920 | +| `height` | *Optional* | :heavy_minus_sign: | N/A | 814 | +| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 2.35 | +| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 2 | +| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | aac | +| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | h264 | +| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 1080 | +| `container` | *Optional* | :heavy_minus_sign: | N/A | mp4 | +| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | +| `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | 0 | +| `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | lc | +| `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | high | +| `part` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsPart](../../models/operations/GetPlaylistContentsPart.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistContentsMediaContainer.md b/docs/models/operations/GetPlaylistContentsMediaContainer.md index ef50ecf2..4b476c10 100644 --- a/docs/models/operations/GetPlaylistContentsMediaContainer.md +++ b/docs/models/operations/GetPlaylistContentsMediaContainer.md @@ -3,14 +3,14 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 2 | -| `composite` | *Optional* | :heavy_minus_sign: | N/A | /playlists/95/composite/1705717521 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 282 | -| `leafCount` | *Optional* | :heavy_minus_sign: | N/A | 2 | -| `playlistType` | *Optional* | :heavy_minus_sign: | N/A | video | -| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 95 | -| `smart` | *Optional* | :heavy_minus_sign: | N/A | true | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Smart Movie Playlist | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsMetadata](../../models/operations/GetPlaylistContentsMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"ratingKey": "17",
"key": "/library/metadata/17",
"guid": "plex://movie/5d77683f6f4521001ea9dc53",
"studio": "Universal Pictures",
"type": "movie",
"title": "Serenity",
"titleSort": "Amazing Spider-Man 2",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "PG-13",
"summary": "Serenity continues the story of the TV series it was based upon (\"Firefly\"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job.",
"rating": 8.2,
"audienceRating": 9.1,
"year": 2005,
"tagline": "They aim to misbehave.",
"thumb": "/library/metadata/17/thumb/1705637165",
"art": "/library/metadata/17/art/1705637165",
"duration": 141416,
"originallyAvailableAt": "2005-09-29T00:00:00Z",
"addedAt": 1705637164,
"updatedAt": 1705637165,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"hasPremiumExtras": "1",
"hasPremiumPrimaryExtra": "1",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 15,
"duration": 141416,
"bitrate": 2273,
"width": 1920,
"height": 814,
"aspectRatio": 2.35,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 0,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 15,
"key": "/library/parts/15/1705637151/file.mp4",
"duration": 141416,
"file": "/movies/Serenity (2005)/Serenity (2005).mp4",
"size": 40271948,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": false,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Science Fiction"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Joss Whedon"
}
],
"Writer": [
{
"tag": "Joss Whedon"
}
],
"Role": [
{
"tag": "Nathan Fillion"
}
]
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 2 | +| `composite` | *Optional* | :heavy_minus_sign: | N/A | /playlists/95/composite/1705717521 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 282 | +| `leafCount` | *Optional* | :heavy_minus_sign: | N/A | 2 | +| `playlistType` | *Optional* | :heavy_minus_sign: | N/A | video | +| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 95 | +| `smart` | *Optional* | :heavy_minus_sign: | N/A | true | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Smart Movie Playlist | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsMetadata](../../models/operations/GetPlaylistContentsMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistContentsMetadata.md b/docs/models/operations/GetPlaylistContentsMetadata.md index b2a01c7a..debdf9c0 100644 --- a/docs/models/operations/GetPlaylistContentsMetadata.md +++ b/docs/models/operations/GetPlaylistContentsMetadata.md @@ -3,37 +3,37 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 17 | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17 | -| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5d77683f6f4521001ea9dc53 | -| `studio` | *Optional* | :heavy_minus_sign: | N/A | Universal Pictures | -| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Serenity | -| `titleSort` | *Optional* | :heavy_minus_sign: | N/A | Amazing Spider-Man 2 | -| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `librarySectionKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1 | -| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | -| `summary` | *Optional* | :heavy_minus_sign: | N/A | Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job. | -| `rating` | *Optional* | :heavy_minus_sign: | N/A | 8.2 | -| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 9.1 | -| `year` | *Optional* | :heavy_minus_sign: | N/A | 2005 | -| `tagline` | *Optional* | :heavy_minus_sign: | N/A | They aim to misbehave. | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17/thumb/1705637165 | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17/art/1705637165 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141416 | -| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2005-09-29 00:00:00 +0000 UTC | -| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705637164 | -| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705637165 | -| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | -| `hasPremiumExtras` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `hasPremiumPrimaryExtra` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | -| `media` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsMedia](../../models/operations/GetPlaylistContentsMedia.md)> | :heavy_minus_sign: | N/A | [
{
"id": 15,
"duration": 141416,
"bitrate": 2273,
"width": 1920,
"height": 814,
"aspectRatio": 2.35,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 0,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 15,
"key": "/library/parts/15/1705637151/file.mp4",
"duration": 141416,
"file": "/movies/Serenity (2005)/Serenity (2005).mp4",
"size": 40271948,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": false,
"videoProfile": "high"
}
]
}
] | -| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsGenre](../../models/operations/GetPlaylistContentsGenre.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "Action"
}
] | -| `country` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsCountry](../../models/operations/GetPlaylistContentsCountry.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "United States of America"
}
] | -| `director` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsDirector](../../models/operations/GetPlaylistContentsDirector.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "Joss Whedon"
}
] | -| `writer` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsWriter](../../models/operations/GetPlaylistContentsWriter.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "Joss Whedon"
}
] | -| `role` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsRole](../../models/operations/GetPlaylistContentsRole.md)> | :heavy_minus_sign: | N/A | [
{
"tag": "Gina Torres"
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 17 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17 | +| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5d77683f6f4521001ea9dc53 | +| `studio` | *Optional* | :heavy_minus_sign: | N/A | Universal Pictures | +| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Serenity | +| `titleSort` | *Optional* | :heavy_minus_sign: | N/A | Amazing Spider-Man 2 | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1 | +| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | +| `summary` | *Optional* | :heavy_minus_sign: | N/A | Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job. | +| `rating` | *Optional* | :heavy_minus_sign: | N/A | 8.2 | +| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 9.1 | +| `year` | *Optional* | :heavy_minus_sign: | N/A | 2005 | +| `tagline` | *Optional* | :heavy_minus_sign: | N/A | They aim to misbehave. | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17/thumb/1705637165 | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17/art/1705637165 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141416 | +| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2005-09-29 00:00:00 +0000 UTC | +| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705637164 | +| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705637165 | +| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `hasPremiumExtras` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `hasPremiumPrimaryExtra` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | +| `media` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsMedia](../../models/operations/GetPlaylistContentsMedia.md)> | :heavy_minus_sign: | N/A | | +| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsGenre](../../models/operations/GetPlaylistContentsGenre.md)> | :heavy_minus_sign: | N/A | | +| `country` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsCountry](../../models/operations/GetPlaylistContentsCountry.md)> | :heavy_minus_sign: | N/A | | +| `director` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsDirector](../../models/operations/GetPlaylistContentsDirector.md)> | :heavy_minus_sign: | N/A | | +| `writer` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsWriter](../../models/operations/GetPlaylistContentsWriter.md)> | :heavy_minus_sign: | N/A | | +| `role` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsRole](../../models/operations/GetPlaylistContentsRole.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistContentsPlaylistsResponseBody.md b/docs/models/operations/GetPlaylistContentsPlaylistsResponseBody.md deleted file mode 100644 index e0e8f4a7..00000000 --- a/docs/models/operations/GetPlaylistContentsPlaylistsResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistContentsPlaylistsResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsErrors](../../models/operations/GetPlaylistContentsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistContentsResponse.md b/docs/models/operations/GetPlaylistContentsResponse.md index ae612d09..0a38d5ef 100644 --- a/docs/models/operations/GetPlaylistContentsResponse.md +++ b/docs/models/operations/GetPlaylistContentsResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetPlaylistContentsResponseBody.md) | :heavy_minus_sign: | The playlist contents | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetPlaylistContentsPlaylistsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetPlaylistMediaContainer.md b/docs/models/operations/GetPlaylistMediaContainer.md index ce867114..22519402 100644 --- a/docs/models/operations/GetPlaylistMediaContainer.md +++ b/docs/models/operations/GetPlaylistMediaContainer.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistMetadata](../../models/operations/GetPlaylistMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"content": "library://x/directory/%2Flibrary%2Fsections%2F1%2Fall%3Ftype%3D1%26push%3D1%26title%3D2%26or%3D1%26title%3DSerenity%26pop%3D1",
"ratingKey": "95",
"key": "/playlists/95/items",
"guid": "com.plexapp.agents.none://87425529-380f-44b8-a689-9a0537e7ec91",
"type": "playlist",
"title": "Smart Movie Playlist",
"summary": "",
"smart": true,
"playlistType": "video",
"composite": "/playlists/95/composite/1705717387",
"icon": "playlist://image.smart",
"duration": 282000,
"leafCount": 2,
"addedAt": 1705716493,
"updatedAt": 1705717387
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistMetadata](../../models/operations/GetPlaylistMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistPlaylistsResponseBody.md b/docs/models/operations/GetPlaylistPlaylistsResponseBody.md deleted file mode 100644 index c5e052d4..00000000 --- a/docs/models/operations/GetPlaylistPlaylistsResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistPlaylistsResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistErrors](../../models/operations/GetPlaylistErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistResponse.md b/docs/models/operations/GetPlaylistResponse.md index 87066de6..b11348c3 100644 --- a/docs/models/operations/GetPlaylistResponse.md +++ b/docs/models/operations/GetPlaylistResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetPlaylistResponseBody.md) | :heavy_minus_sign: | The playlist | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetPlaylistPlaylistsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetPlaylistsMediaContainer.md b/docs/models/operations/GetPlaylistsMediaContainer.md index 99cc92d5..f56fb32b 100644 --- a/docs/models/operations/GetPlaylistsMediaContainer.md +++ b/docs/models/operations/GetPlaylistsMediaContainer.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 4 | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistsMetadata](../../models/operations/GetPlaylistsMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"ratingKey": "92",
"key": "/playlists/92/items",
"guid": "com.plexapp.agents.none://7ca5aaef-58e8-4828-9e21-c009c97f2903",
"type": "playlist",
"title": "Static Playlist",
"summary": "A Great Playlist",
"smart": false,
"playlistType": "video",
"composite": "/playlists/92/composite/1705716440",
"icon": "playlist://image.smart",
"viewCount": 1,
"lastViewedAt": 1705716298,
"duration": 7328000,
"leafCount": 32,
"addedAt": 1705716298,
"updatedAt": 1705716440
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 4 | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistsMetadata](../../models/operations/GetPlaylistsMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistsPlaylistsResponseBody.md b/docs/models/operations/GetPlaylistsPlaylistsResponseBody.md deleted file mode 100644 index 0e2a73ea..00000000 --- a/docs/models/operations/GetPlaylistsPlaylistsResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistsPlaylistsResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetPlaylistsErrors](../../models/operations/GetPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistsResponse.md b/docs/models/operations/GetPlaylistsResponse.md index cc923dad..6bc16b5a 100644 --- a/docs/models/operations/GetPlaylistsResponse.md +++ b/docs/models/operations/GetPlaylistsResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetPlaylistsResponseBody.md) | :heavy_minus_sign: | returns all playlists | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetPlaylistsPlaylistsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetRecentlyAddedMediaContainer.md b/docs/models/operations/GetRecentlyAddedMediaContainer.md index b238aed3..306f9e1b 100644 --- a/docs/models/operations/GetRecentlyAddedMediaContainer.md +++ b/docs/models/operations/GetRecentlyAddedMediaContainer.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 50 | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | | -| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1680021154 | -| `mixedParents` | *Optional* | :heavy_minus_sign: | N/A | | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.Metadata](../../models/operations/Metadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 50 | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | | +| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1680021154 | +| `mixedParents` | *Optional* | :heavy_minus_sign: | N/A | | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedMetadata](../../models/operations/GetRecentlyAddedMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetRecentlyAddedMetadata.md b/docs/models/operations/GetRecentlyAddedMetadata.md new file mode 100644 index 00000000..9e0d6ab1 --- /dev/null +++ b/docs/models/operations/GetRecentlyAddedMetadata.md @@ -0,0 +1,39 @@ +# GetRecentlyAddedMetadata + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 59398 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/59398 | +| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5e161a83bea6ac004126e148 | +| `studio` | *Optional* | :heavy_minus_sign: | N/A | Marvel Studios | +| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Ant-Man and the Wasp: Quantumania | +| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | +| `summary` | *Optional* | :heavy_minus_sign: | N/A | Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible. | +| `rating` | *Optional* | :heavy_minus_sign: | N/A | 4.7 | +| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 8.3 | +| `year` | *Optional* | :heavy_minus_sign: | N/A | 2023 | +| `tagline` | *Optional* | :heavy_minus_sign: | N/A | Witness the beginning of a new dynasty. | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/59398/thumb/1681888010 | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/59398/art/1681888010 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 7474422 | +| `originallyAvailableAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | 2023-02-15 00:00:00 +0000 UTC | +| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1681803215 | +| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1681888010 | +| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `chapterSource` | *Optional* | :heavy_minus_sign: | N/A | media | +| `primaryExtraKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/59399 | +| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.rotten | +| `media` | List<[lukehagar.plexapi.plexapi.models.operations.Media](../../models/operations/Media.md)> | :heavy_minus_sign: | N/A | | +| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.Genre](../../models/operations/Genre.md)> | :heavy_minus_sign: | N/A | | +| `director` | List<[lukehagar.plexapi.plexapi.models.operations.Director](../../models/operations/Director.md)> | :heavy_minus_sign: | N/A | | +| `writer` | List<[lukehagar.plexapi.plexapi.models.operations.Writer](../../models/operations/Writer.md)> | :heavy_minus_sign: | N/A | | +| `country` | List<[lukehagar.plexapi.plexapi.models.operations.Country](../../models/operations/Country.md)> | :heavy_minus_sign: | N/A | | +| `role` | List<[lukehagar.plexapi.plexapi.models.operations.Role](../../models/operations/Role.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetRecentlyAddedResponse.md b/docs/models/operations/GetRecentlyAddedResponse.md index 9f1ebcab..3e7d6a0a 100644 --- a/docs/models/operations/GetRecentlyAddedResponse.md +++ b/docs/models/operations/GetRecentlyAddedResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetRecentlyAddedResponseBody.md) | :heavy_minus_sign: | The recently added content | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetRecentlyAddedLibraryResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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: | The recently added content | \ No newline at end of file diff --git a/docs/models/operations/GetResizedPhotoResponse.md b/docs/models/operations/GetResizedPhotoResponse.md index f9980d54..96b79fde 100644 --- a/docs/models/operations/GetResizedPhotoResponse.md +++ b/docs/models/operations/GetResizedPhotoResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/GetResizedPhotoResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetResizedPhotoResponseBody.md b/docs/models/operations/GetResizedPhotoResponseBody.md deleted file mode 100644 index d5880aa8..00000000 --- a/docs/models/operations/GetResizedPhotoResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetResizedPhotoResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoErrors](../../models/operations/GetResizedPhotoErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetResourcesStatisticsMediaContainer.md b/docs/models/operations/GetResourcesStatisticsMediaContainer.md new file mode 100644 index 00000000..09ac5306 --- /dev/null +++ b/docs/models/operations/GetResourcesStatisticsMediaContainer.md @@ -0,0 +1,9 @@ +# GetResourcesStatisticsMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 5497 | +| `statisticsResources` | List<[lukehagar.plexapi.plexapi.models.operations.StatisticsResources](../../models/operations/StatisticsResources.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetResourcesStatisticsRequest.md b/docs/models/operations/GetResourcesStatisticsRequest.md new file mode 100644 index 00000000..34d1c461 --- /dev/null +++ b/docs/models/operations/GetResourcesStatisticsRequest.md @@ -0,0 +1,8 @@ +# GetResourcesStatisticsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `timespan` | *Optional* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | \ No newline at end of file diff --git a/docs/models/operations/GetResourcesStatisticsResponse.md b/docs/models/operations/GetResourcesStatisticsResponse.md new file mode 100644 index 00000000..00717d9e --- /dev/null +++ b/docs/models/operations/GetResourcesStatisticsResponse.md @@ -0,0 +1,11 @@ +# GetResourcesStatisticsResponse + + +## 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 diff --git a/docs/models/operations/ClearPlaylistContentsResponseBody.md b/docs/models/operations/GetResourcesStatisticsResponseBody.md similarity index 51% rename from docs/models/operations/ClearPlaylistContentsResponseBody.md rename to docs/models/operations/GetResourcesStatisticsResponseBody.md index 14faed5b..a09ff43a 100644 --- a/docs/models/operations/ClearPlaylistContentsResponseBody.md +++ b/docs/models/operations/GetResourcesStatisticsResponseBody.md @@ -1,10 +1,10 @@ -# ClearPlaylistContentsResponseBody +# GetResourcesStatisticsResponseBody -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +Resource Statistics ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsErrors](../../models/operations/ClearPlaylistContentsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `mediaContainer` | [Optional](../../models/operations/GetResourcesStatisticsMediaContainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetSearchResultsResponse.md b/docs/models/operations/GetSearchResultsResponse.md index be7680f3..db4b5ccf 100644 --- a/docs/models/operations/GetSearchResultsResponse.md +++ b/docs/models/operations/GetSearchResultsResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetSearchResultsResponseBody.md) | :heavy_minus_sign: | Search Results | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetSearchResultsSearchResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetServerActivitiesActivitiesResponseBody.md b/docs/models/operations/GetServerActivitiesActivitiesResponseBody.md deleted file mode 100644 index 821d3ee0..00000000 --- a/docs/models/operations/GetServerActivitiesActivitiesResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerActivitiesActivitiesResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesErrors](../../models/operations/GetServerActivitiesErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetServerActivitiesResponse.md b/docs/models/operations/GetServerActivitiesResponse.md index 78ef98c0..bbcf6a2d 100644 --- a/docs/models/operations/GetServerActivitiesResponse.md +++ b/docs/models/operations/GetServerActivitiesResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetServerActivitiesResponseBody.md) | :heavy_minus_sign: | The Server Activities | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetServerActivitiesActivitiesResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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 9a56a215..5e420f40 100644 --- a/docs/models/operations/GetServerCapabilitiesResponse.md +++ b/docs/models/operations/GetServerCapabilitiesResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetServerCapabilitiesResponseBody.md) | :heavy_minus_sign: | The Server Capabilities | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetServerCapabilitiesServerResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetServerCapabilitiesServerResponseBody.md b/docs/models/operations/GetServerCapabilitiesServerResponseBody.md deleted file mode 100644 index 593761d9..00000000 --- a/docs/models/operations/GetServerCapabilitiesServerResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerCapabilitiesServerResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.Errors](../../models/operations/Errors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetServerIdentityResponse.md b/docs/models/operations/GetServerIdentityResponse.md index b502da76..4397105f 100644 --- a/docs/models/operations/GetServerIdentityResponse.md +++ b/docs/models/operations/GetServerIdentityResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetServerIdentityResponseBody.md) | :heavy_minus_sign: | The Server Identity information | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetServerIdentityServerResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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 28eeec7f..1c2ea683 100644 --- a/docs/models/operations/GetServerListResponse.md +++ b/docs/models/operations/GetServerListResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetServerListResponseBody.md) | :heavy_minus_sign: | List of Servers | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetServerListServerResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetServerListServerResponseBody.md b/docs/models/operations/GetServerListServerResponseBody.md deleted file mode 100644 index ff655ac1..00000000 --- a/docs/models/operations/GetServerListServerResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerListServerResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetServerListErrors](../../models/operations/GetServerListErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetServerPreferencesMediaContainer.md b/docs/models/operations/GetServerPreferencesMediaContainer.md index 21a8b462..d42423c2 100644 --- a/docs/models/operations/GetServerPreferencesMediaContainer.md +++ b/docs/models/operations/GetServerPreferencesMediaContainer.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 161 | -| `setting` | List<[lukehagar.plexapi.plexapi.models.operations.Setting](../../models/operations/Setting.md)> | :heavy_minus_sign: | N/A | [
{
"id": "EnableDatabaseTrace",
"label": "",
"summary": "",
"type": "bool",
"default": false,
"value": false,
"hidden": true,
"advanced": false,
"group": "",
"enumValues": "1:admin only\|2:everyone"
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 161 | +| `setting` | List<[lukehagar.plexapi.plexapi.models.operations.Setting](../../models/operations/Setting.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetServerPreferencesResponse.md b/docs/models/operations/GetServerPreferencesResponse.md index df891888..a29a49bd 100644 --- a/docs/models/operations/GetServerPreferencesResponse.md +++ b/docs/models/operations/GetServerPreferencesResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetServerPreferencesResponseBody.md) | :heavy_minus_sign: | Server Preferences | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetServerPreferencesServerResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetServerPreferencesServerResponseBody.md b/docs/models/operations/GetServerPreferencesServerResponseBody.md deleted file mode 100644 index 3576a991..00000000 --- a/docs/models/operations/GetServerPreferencesServerResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerPreferencesServerResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesErrors](../../models/operations/GetServerPreferencesErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetSessionHistoryMediaContainer.md b/docs/models/operations/GetSessionHistoryMediaContainer.md index 21ecfb5a..f6975f46 100644 --- a/docs/models/operations/GetSessionHistoryMediaContainer.md +++ b/docs/models/operations/GetSessionHistoryMediaContainer.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 10855 | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryMetadata](../../models/operations/GetSessionHistoryMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"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
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 10855 | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryMetadata](../../models/operations/GetSessionHistoryMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetSessionHistoryRequest.md b/docs/models/operations/GetSessionHistoryRequest.md new file mode 100644 index 00000000..5e0afc64 --- /dev/null +++ b/docs/models/operations/GetSessionHistoryRequest.md @@ -0,0 +1,11 @@ +# GetSessionHistoryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sort` | *Optional* | :heavy_minus_sign: | Sorts the results by the specified field followed by the direction (asc, desc)
| | +| `accountId` | *Optional* | :heavy_minus_sign: | Filter results by those that are related to a specific users id
| 1 | +| `filter` | [Optional](../../models/operations/Filter.md) | :heavy_minus_sign: | Filters content by field and direction/equality
(Unknown if viewedAt is the only supported column)
| {
"viewed-at-greater-than": {
"value": "viewedAt\u003e"
},
"viewed-at-greater-than-or-equal-to": {
"value": "viewedAt\u003e=\u003e"
},
"viewed-at-less-than": {
"value": "viewedAt\u003c"
}
} | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | Filters the results based on the id of a valid library section
| 12 | \ No newline at end of file diff --git a/docs/models/operations/GetSessionHistoryResponse.md b/docs/models/operations/GetSessionHistoryResponse.md index 14cbf3f3..fea111ce 100644 --- a/docs/models/operations/GetSessionHistoryResponse.md +++ b/docs/models/operations/GetSessionHistoryResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetSessionHistoryResponseBody.md) | :heavy_minus_sign: | List of Plex Sessions | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetSessionHistorySessionsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetSessionHistorySessionsResponseBody.md b/docs/models/operations/GetSessionHistorySessionsResponseBody.md deleted file mode 100644 index da0f79ad..00000000 --- a/docs/models/operations/GetSessionHistorySessionsResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSessionHistorySessionsResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryErrors](../../models/operations/GetSessionHistoryErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetSessionsMedia.md b/docs/models/operations/GetSessionsMedia.md index 10a584ce..a61657cd 100644 --- a/docs/models/operations/GetSessionsMedia.md +++ b/docs/models/operations/GetSessionsMedia.md @@ -3,13 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 2 | -| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | flac | -| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 1014 | -| `container` | *Optional* | :heavy_minus_sign: | N/A | flac | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 186240 | -| `id` | *Optional* | :heavy_minus_sign: | N/A | 130355 | -| `selected` | *Optional* | :heavy_minus_sign: | N/A | true | -| `part` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionsPart](../../models/operations/GetSessionsPart.md)> | :heavy_minus_sign: | N/A | [
{
"container": "flac",
"duration": 186240,
"file": "/music/Green Day/Saviors (2024)/Green Day - Saviors - 01 - The American Dream Is Killing Me.flac",
"hasThumbnail": "1",
"id": "130625",
"key": "/library/parts/130625/1705543268/file.flac",
"size": 23644000,
"decision": "directplay",
"selected": true,
"Stream": [
{
"albumGain": "-12.94",
"albumPeak": "1.000000",
"albumRange": "4.751014",
"audioChannelLayout": "stereo",
"bitDepth": 16,
"bitrate": 1014,
"channels": 2,
"codec": "flac",
"displayTitle": "FLAC (Stereo)",
"extendedDisplayTitle": "FLAC (Stereo)",
"gain": "-12.94",
"id": "352487",
"index": 0,
"loudness": "-5.94",
"lra": "1.74",
"peak": "1.000000",
"samplingRate": 44100,
"selected": true,
"streamType": 2,
"location": "direct"
}
]
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 2 | +| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | flac | +| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 1014 | +| `container` | *Optional* | :heavy_minus_sign: | N/A | flac | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 186240 | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 130355 | +| `selected` | *Optional* | :heavy_minus_sign: | N/A | true | +| `part` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionsPart](../../models/operations/GetSessionsPart.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetSessionsMediaContainer.md b/docs/models/operations/GetSessionsMediaContainer.md index 7566517a..4ded5a8e 100644 --- a/docs/models/operations/GetSessionsMediaContainer.md +++ b/docs/models/operations/GetSessionsMediaContainer.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionsMetadata](../../models/operations/GetSessionsMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"addedAt": 1705543312,
"art": "/library/metadata/39904/art/1705310687",
"duration": 186240,
"grandparentArt": "/library/metadata/39904/art/1705310687",
"grandparentGuid": "plex://artist/5d07bbfd403c6402904a6480",
"grandparentKey": "/library/metadata/39904",
"grandparentRatingKey": "39904",
"grandparentThumb": "/library/metadata/39904/thumb/1705310687",
"grandparentTitle": "Green Day",
"guid": "plex://track/6535834f71f22f36f71a8e8f",
"index": 1,
"key": "/library/metadata/67085",
"librarySectionID": "3",
"librarySectionKey": "/library/sections/3",
"librarySectionTitle": "Music",
"musicAnalysisVersion": "1",
"parentGuid": "plex://album/65394d6d472b8ab03ef47f12",
"parentIndex": 1,
"parentKey": "/library/metadata/67084",
"parentRatingKey": "67084",
"parentStudio": "Reprise Records",
"parentThumb": "/library/metadata/67084/thumb/1705543314",
"parentTitle": "Saviors",
"parentYear": 2024,
"ratingCount": 45885,
"ratingKey": "67085",
"sessionKey": "203",
"thumb": "/library/metadata/67084/thumb/1705543314",
"title": "The American Dream Is Killing Me",
"titleSort": "American Dream Is Killing Me",
"type": "track",
"updatedAt": 1705543314,
"viewOffset": 1000,
"Media": [
{
"audioChannels": 2,
"audioCodec": "flac",
"bitrate": 1014,
"container": "flac",
"duration": 186240,
"id": "130355",
"selected": true,
"Part": [
{
"container": "flac",
"duration": 186240,
"file": "/music/Green Day/Saviors (2024)/Green Day - Saviors - 01 - The American Dream Is Killing Me.flac",
"hasThumbnail": "1",
"id": "130625",
"key": "/library/parts/130625/1705543268/file.flac",
"size": 23644000,
"decision": "directplay",
"selected": true,
"Stream": [
{
"albumGain": "-12.94",
"albumPeak": "1.000000",
"albumRange": "4.751014",
"audioChannelLayout": "stereo",
"bitDepth": 16,
"bitrate": 1014,
"channels": 2,
"codec": "flac",
"displayTitle": "FLAC (Stereo)",
"extendedDisplayTitle": "FLAC (Stereo)",
"gain": "-12.94",
"id": "352487",
"index": 0,
"loudness": "-5.94",
"lra": "1.74",
"peak": "1.000000",
"samplingRate": 44100,
"selected": true,
"streamType": 2,
"location": "direct"
}
]
}
]
}
],
"User": {
"id": "1",
"thumb": "https://plex.tv/users/844780fc6f8a26b5/avatar?c=1705853661",
"title": "Blindkitty38"
},
"Player": {
"address": "10.10.10.171",
"machineIdentifier": "3tsdzir85m2onc3qyr255aq1",
"model": "standalone",
"platform": "windows",
"platformVersion": "10.0.22621",
"product": "Plex for Windows",
"profile": "Plex Desktop",
"remotePublicAddress": "68.248.140.20",
"state": "playing",
"title": "DESKTOP-BL80MTD",
"version": "1.85.0.4071-21128b56",
"local": true,
"relayed": false,
"secure": true,
"userID": 1
},
"Session": {
"id": "93h7e00ncblxncqw9lkfaoxi",
"bandwidth": 1050,
"location": "lan"
}
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionsMetadata](../../models/operations/GetSessionsMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetSessionsMetadata.md b/docs/models/operations/GetSessionsMetadata.md index 85298c01..77bfb3cc 100644 --- a/docs/models/operations/GetSessionsMetadata.md +++ b/docs/models/operations/GetSessionsMetadata.md @@ -3,42 +3,42 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705543312 | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/39904/art/1705310687 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 186240 | -| `grandparentArt` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/39904/art/1705310687 | -| `grandparentGuid` | *Optional* | :heavy_minus_sign: | N/A | plex://artist/5d07bbfd403c6402904a6480 | -| `grandparentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/39904 | -| `grandparentRatingKey` | *Optional* | :heavy_minus_sign: | N/A | 39904 | -| `grandparentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/39904/thumb/1705310687 | -| `grandparentTitle` | *Optional* | :heavy_minus_sign: | N/A | Green Day | -| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://track/6535834f71f22f36f71a8e8f | -| `index` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/67085 | -| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 3 | -| `librarySectionKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/3 | -| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Music | -| `musicAnalysisVersion` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `parentGuid` | *Optional* | :heavy_minus_sign: | N/A | plex://album/65394d6d472b8ab03ef47f12 | -| `parentIndex` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `parentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/67084 | -| `parentRatingKey` | *Optional* | :heavy_minus_sign: | N/A | 67084 | -| `parentStudio` | *Optional* | :heavy_minus_sign: | N/A | Reprise Records | -| `parentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/67084/thumb/1705543314 | -| `parentTitle` | *Optional* | :heavy_minus_sign: | N/A | Saviors | -| `parentYear` | *Optional* | :heavy_minus_sign: | N/A | 2024 | -| `ratingCount` | *Optional* | :heavy_minus_sign: | N/A | 45885 | -| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 67085 | -| `sessionKey` | *Optional* | :heavy_minus_sign: | N/A | 203 | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/67084/thumb/1705543314 | -| `title` | *Optional* | :heavy_minus_sign: | N/A | The American Dream Is Killing Me | -| `titleSort` | *Optional* | :heavy_minus_sign: | N/A | American Dream Is Killing Me | -| `type` | *Optional* | :heavy_minus_sign: | N/A | track | -| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705543314 | -| `viewOffset` | *Optional* | :heavy_minus_sign: | N/A | 1000 | -| `media` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionsMedia](../../models/operations/GetSessionsMedia.md)> | :heavy_minus_sign: | N/A | [
{
"audioChannels": 2,
"audioCodec": "flac",
"bitrate": 1014,
"container": "flac",
"duration": 186240,
"id": "130355",
"selected": true,
"Part": [
{
"container": "flac",
"duration": 186240,
"file": "/music/Green Day/Saviors (2024)/Green Day - Saviors - 01 - The American Dream Is Killing Me.flac",
"hasThumbnail": "1",
"id": "130625",
"key": "/library/parts/130625/1705543268/file.flac",
"size": 23644000,
"decision": "directplay",
"selected": true,
"Stream": [
{
"albumGain": "-12.94",
"albumPeak": "1.000000",
"albumRange": "4.751014",
"audioChannelLayout": "stereo",
"bitDepth": 16,
"bitrate": 1014,
"channels": 2,
"codec": "flac",
"displayTitle": "FLAC (Stereo)",
"extendedDisplayTitle": "FLAC (Stereo)",
"gain": "-12.94",
"id": "352487",
"index": 0,
"loudness": "-5.94",
"lra": "1.74",
"peak": "1.000000",
"samplingRate": 44100,
"selected": true,
"streamType": 2,
"location": "direct"
}
]
}
]
}
] | -| `user` | [Optional](../../models/operations/User.md) | :heavy_minus_sign: | N/A | | -| `player` | [Optional](../../models/operations/Player.md) | :heavy_minus_sign: | N/A | | -| `session` | [Optional](../../models/operations/Session.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705543312 | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/39904/art/1705310687 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 186240 | +| `grandparentArt` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/39904/art/1705310687 | +| `grandparentGuid` | *Optional* | :heavy_minus_sign: | N/A | plex://artist/5d07bbfd403c6402904a6480 | +| `grandparentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/39904 | +| `grandparentRatingKey` | *Optional* | :heavy_minus_sign: | N/A | 39904 | +| `grandparentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/39904/thumb/1705310687 | +| `grandparentTitle` | *Optional* | :heavy_minus_sign: | N/A | Green Day | +| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://track/6535834f71f22f36f71a8e8f | +| `index` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/67085 | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 3 | +| `librarySectionKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/3 | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Music | +| `musicAnalysisVersion` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `parentGuid` | *Optional* | :heavy_minus_sign: | N/A | plex://album/65394d6d472b8ab03ef47f12 | +| `parentIndex` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `parentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/67084 | +| `parentRatingKey` | *Optional* | :heavy_minus_sign: | N/A | 67084 | +| `parentStudio` | *Optional* | :heavy_minus_sign: | N/A | Reprise Records | +| `parentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/67084/thumb/1705543314 | +| `parentTitle` | *Optional* | :heavy_minus_sign: | N/A | Saviors | +| `parentYear` | *Optional* | :heavy_minus_sign: | N/A | 2024 | +| `ratingCount` | *Optional* | :heavy_minus_sign: | N/A | 45885 | +| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 67085 | +| `sessionKey` | *Optional* | :heavy_minus_sign: | N/A | 203 | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/67084/thumb/1705543314 | +| `title` | *Optional* | :heavy_minus_sign: | N/A | The American Dream Is Killing Me | +| `titleSort` | *Optional* | :heavy_minus_sign: | N/A | American Dream Is Killing Me | +| `type` | *Optional* | :heavy_minus_sign: | N/A | track | +| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705543314 | +| `viewOffset` | *Optional* | :heavy_minus_sign: | N/A | 1000 | +| `media` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionsMedia](../../models/operations/GetSessionsMedia.md)> | :heavy_minus_sign: | N/A | | +| `user` | [Optional](../../models/operations/GetSessionsUser.md) | :heavy_minus_sign: | N/A | | +| `player` | [Optional](../../models/operations/Player.md) | :heavy_minus_sign: | N/A | | +| `session` | [Optional](../../models/operations/Session.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetSessionsPart.md b/docs/models/operations/GetSessionsPart.md index 83bcbd1d..b7c91baf 100644 --- a/docs/models/operations/GetSessionsPart.md +++ b/docs/models/operations/GetSessionsPart.md @@ -3,15 +3,15 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `container` | *Optional* | :heavy_minus_sign: | N/A | flac | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 186240 | -| `file` | *Optional* | :heavy_minus_sign: | N/A | /music/Green Day/Saviors (2024)/Green Day - Saviors - 01 - The American Dream Is Killing Me.flac | -| `hasThumbnail` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `id` | *Optional* | :heavy_minus_sign: | N/A | 130625 | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/parts/130625/1705543268/file.flac | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 23644000 | -| `decision` | *Optional* | :heavy_minus_sign: | N/A | directplay | -| `selected` | *Optional* | :heavy_minus_sign: | N/A | true | -| `stream` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionsStream](../../models/operations/GetSessionsStream.md)> | :heavy_minus_sign: | N/A | [
{
"albumGain": "-12.94",
"albumPeak": "1.000000",
"albumRange": "4.751014",
"audioChannelLayout": "stereo",
"bitDepth": 16,
"bitrate": 1014,
"channels": 2,
"codec": "flac",
"displayTitle": "FLAC (Stereo)",
"extendedDisplayTitle": "FLAC (Stereo)",
"gain": "-12.94",
"id": "352487",
"index": 0,
"loudness": "-5.94",
"lra": "1.74",
"peak": "1.000000",
"samplingRate": 44100,
"selected": true,
"streamType": 2,
"location": "direct"
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `container` | *Optional* | :heavy_minus_sign: | N/A | flac | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 186240 | +| `file` | *Optional* | :heavy_minus_sign: | N/A | /music/Green Day/Saviors (2024)/Green Day - Saviors - 01 - The American Dream Is Killing Me.flac | +| `hasThumbnail` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 130625 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/parts/130625/1705543268/file.flac | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 23644000 | +| `decision` | *Optional* | :heavy_minus_sign: | N/A | directplay | +| `selected` | *Optional* | :heavy_minus_sign: | N/A | true | +| `stream` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionsStream](../../models/operations/GetSessionsStream.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetSessionsResponse.md b/docs/models/operations/GetSessionsResponse.md index 52cac25b..420f701c 100644 --- a/docs/models/operations/GetSessionsResponse.md +++ b/docs/models/operations/GetSessionsResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetSessionsResponseBody.md) | :heavy_minus_sign: | List of Active Plex Sessions | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetSessionsSessionsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetSessionsSessionsResponseBody.md b/docs/models/operations/GetSessionsSessionsResponseBody.md deleted file mode 100644 index bafac48a..00000000 --- a/docs/models/operations/GetSessionsSessionsResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSessionsSessionsResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetSessionsErrors](../../models/operations/GetSessionsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetSessionsUser.md b/docs/models/operations/GetSessionsUser.md new file mode 100644 index 00000000..9eaae842 --- /dev/null +++ b/docs/models/operations/GetSessionsUser.md @@ -0,0 +1,10 @@ +# GetSessionsUser + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | https://plex.tv/users/844780fc6f8a26b5/avatar?c=1705853661 | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Blindkitty38 | \ No newline at end of file diff --git a/docs/models/operations/GetSourceConnectionInformationResponse.md b/docs/models/operations/GetSourceConnectionInformationResponse.md index a9b00f93..5b2be7e3 100644 --- a/docs/models/operations/GetSourceConnectionInformationResponse.md +++ b/docs/models/operations/GetSourceConnectionInformationResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/GetSourceConnectionInformationResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetSourceConnectionInformationResponseBody.md b/docs/models/operations/GetSourceConnectionInformationResponseBody.md deleted file mode 100644 index 80e0f17e..00000000 --- a/docs/models/operations/GetSourceConnectionInformationResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSourceConnectionInformationResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationErrors](../../models/operations/GetSourceConnectionInformationErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetStatisticsMediaContainer.md b/docs/models/operations/GetStatisticsMediaContainer.md index 1b7c2319..8059827a 100644 --- a/docs/models/operations/GetStatisticsMediaContainer.md +++ b/docs/models/operations/GetStatisticsMediaContainer.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 5497 | -| `device` | List<[lukehagar.plexapi.plexapi.models.operations.GetStatisticsDevice](../../models/operations/GetStatisticsDevice.md)> | :heavy_minus_sign: | N/A | [
{
"id": 208,
"name": "Roku Express",
"platform": "Roku",
"clientIdentifier": "793095d235660625108ef785cc7646e9",
"createdAt": 1706470556
}
] | -| `account` | List<[lukehagar.plexapi.plexapi.models.operations.Account](../../models/operations/Account.md)> | :heavy_minus_sign: | N/A | [
{
"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` | List<[lukehagar.plexapi.plexapi.models.operations.StatisticsMedia](../../models/operations/StatisticsMedia.md)> | :heavy_minus_sign: | N/A | [
{
"accountID": 1,
"deviceID": 13,
"timespan": 4,
"at": 1707141600,
"metadataType": 4,
"count": 1,
"duration": 1555
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 5497 | +| `device` | List<[lukehagar.plexapi.plexapi.models.operations.GetStatisticsDevice](../../models/operations/GetStatisticsDevice.md)> | :heavy_minus_sign: | N/A | | +| `account` | List<[lukehagar.plexapi.plexapi.models.operations.Account](../../models/operations/Account.md)> | :heavy_minus_sign: | N/A | | +| `statisticsMedia` | List<[lukehagar.plexapi.plexapi.models.operations.StatisticsMedia](../../models/operations/StatisticsMedia.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetStatisticsRequest.md b/docs/models/operations/GetStatisticsRequest.md index 833e13a5..4eb7fa5a 100644 --- a/docs/models/operations/GetStatisticsRequest.md +++ b/docs/models/operations/GetStatisticsRequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `timespan` | *Optional* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `timespan` | *Optional* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | \ No newline at end of file diff --git a/docs/models/operations/GetStatisticsResponse.md b/docs/models/operations/GetStatisticsResponse.md index a3090e42..eccf9dbf 100644 --- a/docs/models/operations/GetStatisticsResponse.md +++ b/docs/models/operations/GetStatisticsResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetStatisticsResponseBody.md) | :heavy_minus_sign: | Media Statistics | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetStatisticsStatisticsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetStatisticsStatisticsResponseBody.md b/docs/models/operations/GetStatisticsStatisticsResponseBody.md deleted file mode 100644 index d5d4f457..00000000 --- a/docs/models/operations/GetStatisticsStatisticsResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetStatisticsStatisticsResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetStatisticsErrors](../../models/operations/GetStatisticsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetTimelineRequest.md b/docs/models/operations/GetTimelineRequest.md index 9e7a6a97..d66fa5bb 100644 --- a/docs/models/operations/GetTimelineRequest.md +++ b/docs/models/operations/GetTimelineRequest.md @@ -3,15 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `ratingKey` | *double* | :heavy_check_mark: | The rating key of the media item | -| `key` | *String* | :heavy_check_mark: | The key of the media item to get the timeline for | -| `state` | [lukehagar.plexapi.plexapi.models.operations.State](../../models/operations/State.md) | :heavy_check_mark: | The state of the media item | -| `hasMDE` | *double* | :heavy_check_mark: | Whether the media item has MDE | -| `time` | *double* | :heavy_check_mark: | The time of the media item | -| `duration` | *double* | :heavy_check_mark: | The duration of the media item | -| `context` | *String* | :heavy_check_mark: | The context of the media item | -| `playQueueItemID` | *double* | :heavy_check_mark: | The play queue item ID of the media item | -| `playBackTime` | *double* | :heavy_check_mark: | The playback time of the media item | -| `row` | *double* | :heavy_check_mark: | The row of the media item | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `ratingKey` | *double* | :heavy_check_mark: | The rating key of the media item | 23409 | +| `key` | *String* | :heavy_check_mark: | The key of the media item to get the timeline for | /library/metadata/23409 | +| `state` | [lukehagar.plexapi.plexapi.models.operations.State](../../models/operations/State.md) | :heavy_check_mark: | The state of the media item | playing | +| `hasMDE` | *double* | :heavy_check_mark: | Whether the media item has MDE | 1 | +| `time` | *double* | :heavy_check_mark: | The time of the media item | 2000 | +| `duration` | *double* | :heavy_check_mark: | The duration of the media item | 10000 | +| `context` | *String* | :heavy_check_mark: | The context of the media item | home:hub.continueWatching | +| `playQueueItemID` | *double* | :heavy_check_mark: | The play queue item ID of the media item | 1 | +| `playBackTime` | *double* | :heavy_check_mark: | The playback time of the media item | 2000 | +| `row` | *double* | :heavy_check_mark: | The row of the media item | 1 | \ No newline at end of file diff --git a/docs/models/operations/GetTimelineResponse.md b/docs/models/operations/GetTimelineResponse.md index a5e9cf3b..d9a22540 100644 --- a/docs/models/operations/GetTimelineResponse.md +++ b/docs/models/operations/GetTimelineResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/GetTimelineResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetTimelineResponseBody.md b/docs/models/operations/GetTimelineResponseBody.md deleted file mode 100644 index ae9fb10b..00000000 --- a/docs/models/operations/GetTimelineResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTimelineResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetTimelineErrors](../../models/operations/GetTimelineErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetTokenLocation.md b/docs/models/operations/GetTokenLocation.md new file mode 100644 index 00000000..9efd8847 --- /dev/null +++ b/docs/models/operations/GetTokenLocation.md @@ -0,0 +1,17 @@ +# GetTokenLocation + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `code` | *Optional* | :heavy_minus_sign: | N/A | US | +| `europeanUnionMember` | *Optional* | :heavy_minus_sign: | N/A | | +| `continentCode` | *Optional* | :heavy_minus_sign: | N/A | NA | +| `country` | *Optional* | :heavy_minus_sign: | N/A | United States | +| `city` | *Optional* | :heavy_minus_sign: | N/A | Austin | +| `timeZone` | *Optional* | :heavy_minus_sign: | N/A | America/Chicago | +| `postalCode` | *Optional* | :heavy_minus_sign: | N/A | 78732 | +| `inPrivacyRestrictedCountry` | *Optional* | :heavy_minus_sign: | N/A | | +| `subdivisions` | *Optional* | :heavy_minus_sign: | N/A | Texas | +| `coordinates` | *Optional* | :heavy_minus_sign: | N/A | 30.3768 -97.8935 | \ No newline at end of file diff --git a/docs/models/operations/GetTokenRequest.md b/docs/models/operations/GetTokenRequest.md index 35b42626..d65b8bbf 100644 --- a/docs/models/operations/GetTokenRequest.md +++ b/docs/models/operations/GetTokenRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `pinID` | *String* | :heavy_check_mark: | The PinID to retrieve an access token for | -| `xPlexClientIdentifier` | *String* | :heavy_check_mark: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pinID` | *String* | :heavy_check_mark: | The PinID to retrieve an access token for | | +| `xPlexClientIdentifier` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| Postman | \ No newline at end of file diff --git a/docs/models/operations/GetTokenResponse.md b/docs/models/operations/GetTokenResponse.md index 1066b314..770388f1 100644 --- a/docs/models/operations/GetTokenResponse.md +++ b/docs/models/operations/GetTokenResponse.md @@ -8,4 +8,4 @@ | `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/GetTokenResponseBody.md) | :heavy_minus_sign: | X-Plex-Client-Identifier is missing | \ No newline at end of file +| `object` | [Optional](../../models/operations/GetTokenResponseBody.md) | :heavy_minus_sign: | Access Token | \ No newline at end of file diff --git a/docs/models/operations/GetTokenResponseBody.md b/docs/models/operations/GetTokenResponseBody.md index d0380067..b77c5c98 100644 --- a/docs/models/operations/GetTokenResponseBody.md +++ b/docs/models/operations/GetTokenResponseBody.md @@ -1,10 +1,21 @@ # GetTokenResponseBody -X-Plex-Client-Identifier is missing +Access Token ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetTokenErrors](../../models/operations/GetTokenErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | PinID for use with authentication | 1272322473 | +| `code` | *Optional* | :heavy_minus_sign: | N/A | 3patfx1a78ukcbr7x0n9bl26t | +| `product` | *Optional* | :heavy_minus_sign: | N/A | Plex Web | +| `trusted` | *Optional* | :heavy_minus_sign: | N/A | | +| `qr` | *Optional* | :heavy_minus_sign: | a link to a QR code hosted on plex.tv
The QR code redirects to the relevant `plex.tv/link` authentication page
Which then prompts the user for the 4 Digit Link Pin
| https://plex.tv/api/v2/pins/qr/3patfx1a78ukcbr7x0n9bl26t | +| `clientIdentifier` | *Optional* | :heavy_minus_sign: | N/A | Postman | +| `location` | [Optional](../../models/operations/GetTokenLocation.md) | :heavy_minus_sign: | N/A | | +| `expiresIn` | *Optional* | :heavy_minus_sign: | N/A | 1800 | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | 2023-04-12 17:00:03 +0000 UTC | +| `expiresAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | 2023-04-12 17:30:03 +0000 UTC | +| `authToken` | *Optional* | :heavy_minus_sign: | N/A | | +| `newRegistration` | *Optional* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetTopWatchedContentCountry.md b/docs/models/operations/GetTopWatchedContentCountry.md new file mode 100644 index 00000000..d1159880 --- /dev/null +++ b/docs/models/operations/GetTopWatchedContentCountry.md @@ -0,0 +1,10 @@ +# GetTopWatchedContentCountry + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 116 | +| `filter` | *Optional* | :heavy_minus_sign: | N/A | country=116 | +| `tag` | *Optional* | :heavy_minus_sign: | N/A | United States of America | \ No newline at end of file diff --git a/docs/models/operations/GetTopWatchedContentGenre.md b/docs/models/operations/GetTopWatchedContentGenre.md new file mode 100644 index 00000000..fbd95156 --- /dev/null +++ b/docs/models/operations/GetTopWatchedContentGenre.md @@ -0,0 +1,10 @@ +# GetTopWatchedContentGenre + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 184 | +| `filter` | *Optional* | :heavy_minus_sign: | N/A | genre=184 | +| `tag` | *Optional* | :heavy_minus_sign: | N/A | Thriller | \ No newline at end of file diff --git a/docs/models/operations/GetTopWatchedContentGuids.md b/docs/models/operations/GetTopWatchedContentGuids.md new file mode 100644 index 00000000..e4f2f3aa --- /dev/null +++ b/docs/models/operations/GetTopWatchedContentGuids.md @@ -0,0 +1,8 @@ +# GetTopWatchedContentGuids + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | tvdb://2337 | \ No newline at end of file diff --git a/docs/models/operations/GetTopWatchedContentMediaContainer.md b/docs/models/operations/GetTopWatchedContentMediaContainer.md new file mode 100644 index 00000000..6b5094ba --- /dev/null +++ b/docs/models/operations/GetTopWatchedContentMediaContainer.md @@ -0,0 +1,13 @@ +# GetTopWatchedContentMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | +| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1698860922 | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentMetadata](../../models/operations/GetTopWatchedContentMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetTopWatchedContentMetadata.md b/docs/models/operations/GetTopWatchedContentMetadata.md new file mode 100644 index 00000000..ad6b410e --- /dev/null +++ b/docs/models/operations/GetTopWatchedContentMetadata.md @@ -0,0 +1,39 @@ +# GetTopWatchedContentMetadata + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 17 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17 | +| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5d77683f6f4521001ea9dc53 | +| `slug` | *Optional* | :heavy_minus_sign: | N/A | waterloo-road | +| `studio` | *Optional* | :heavy_minus_sign: | N/A | Universal Pictures | +| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Serenity | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1 | +| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | +| `summary` | *Optional* | :heavy_minus_sign: | N/A | Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job. | +| `index` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 9.1 | +| `year` | *Optional* | :heavy_minus_sign: | N/A | 2005 | +| `tagline` | *Optional* | :heavy_minus_sign: | N/A | They aim to misbehave. | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17/thumb/1705637165 | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/17/art/1705637165 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 141417 | +| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2005-09-29 00:00:00 +0000 UTC | +| `leafCount` | *Optional* | :heavy_minus_sign: | N/A | 222 | +| `viewedLeafCount` | *Optional* | :heavy_minus_sign: | N/A | 100 | +| `childCount` | *Optional* | :heavy_minus_sign: | N/A | 13 | +| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705637164 | +| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1705637165 | +| `globalViewCount` | *Optional* | :heavy_minus_sign: | N/A | 80 | +| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentGenre](../../models/operations/GetTopWatchedContentGenre.md)> | :heavy_minus_sign: | N/A | | +| `country` | List<[lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentCountry](../../models/operations/GetTopWatchedContentCountry.md)> | :heavy_minus_sign: | N/A | | +| `guids` | List<[lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentGuids](../../models/operations/GetTopWatchedContentGuids.md)> | :heavy_minus_sign: | N/A | | +| `role` | List<[lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentRole](../../models/operations/GetTopWatchedContentRole.md)> | :heavy_minus_sign: | N/A | | +| `user` | List<[lukehagar.plexapi.plexapi.models.operations.User](../../models/operations/User.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetTopWatchedContentRequest.md b/docs/models/operations/GetTopWatchedContentRequest.md new file mode 100644 index 00000000..cffb1b94 --- /dev/null +++ b/docs/models/operations/GetTopWatchedContentRequest.md @@ -0,0 +1,9 @@ +# GetTopWatchedContentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `type` | *long* | :heavy_check_mark: | the library type (1 - movies, 2 - shows, 3 - music) | | +| `includeGuids` | *Optional* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | \ No newline at end of file diff --git a/docs/models/operations/GetTopWatchedContentResponse.md b/docs/models/operations/GetTopWatchedContentResponse.md new file mode 100644 index 00000000..ea3ae061 --- /dev/null +++ b/docs/models/operations/GetTopWatchedContentResponse.md @@ -0,0 +1,11 @@ +# GetTopWatchedContentResponse + + +## 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 diff --git a/docs/models/operations/GetAvailableClientsServerResponseBody.md b/docs/models/operations/GetTopWatchedContentResponseBody.md similarity index 50% rename from docs/models/operations/GetAvailableClientsServerResponseBody.md rename to docs/models/operations/GetTopWatchedContentResponseBody.md index fbe31588..23fb3d07 100644 --- a/docs/models/operations/GetAvailableClientsServerResponseBody.md +++ b/docs/models/operations/GetTopWatchedContentResponseBody.md @@ -1,10 +1,10 @@ -# GetAvailableClientsServerResponseBody +# GetTopWatchedContentResponseBody -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +The metadata of the library item. ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsErrors](../../models/operations/GetAvailableClientsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `mediaContainer` | [Optional](../../models/operations/GetTopWatchedContentMediaContainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetTopWatchedContentRole.md b/docs/models/operations/GetTopWatchedContentRole.md new file mode 100644 index 00000000..197af673 --- /dev/null +++ b/docs/models/operations/GetTopWatchedContentRole.md @@ -0,0 +1,13 @@ +# GetTopWatchedContentRole + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 220 | +| `filter` | *Optional* | :heavy_minus_sign: | N/A | actor=220 | +| `tag` | *Optional* | :heavy_minus_sign: | N/A | Dennis Keiffer | +| `tagKey` | *Optional* | :heavy_minus_sign: | N/A | 5d77683554f42c001f8c4708 | +| `role` | *Optional* | :heavy_minus_sign: | N/A | Bar Guy (uncredited) | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | https://metadata-static.plex.tv/6/people/648e9a7ea1d537bccfcd7615134b78ce.jpg | \ No newline at end of file diff --git a/docs/models/operations/GetTranscodeSessionsResponse.md b/docs/models/operations/GetTranscodeSessionsResponse.md index 9ba06503..9cb8395b 100644 --- a/docs/models/operations/GetTranscodeSessionsResponse.md +++ b/docs/models/operations/GetTranscodeSessionsResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetTranscodeSessionsResponseBody.md) | :heavy_minus_sign: | The Transcode Sessions | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetTranscodeSessionsSessionsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetTranscodeSessionsSessionsResponseBody.md b/docs/models/operations/GetTranscodeSessionsSessionsResponseBody.md deleted file mode 100644 index 9d0e8c9e..00000000 --- a/docs/models/operations/GetTranscodeSessionsSessionsResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTranscodeSessionsSessionsResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsErrors](../../models/operations/GetTranscodeSessionsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetTransientTokenResponse.md b/docs/models/operations/GetTransientTokenResponse.md index 68843db0..ecf13876 100644 --- a/docs/models/operations/GetTransientTokenResponse.md +++ b/docs/models/operations/GetTransientTokenResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/GetTransientTokenResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetTransientTokenResponseBody.md b/docs/models/operations/GetTransientTokenResponseBody.md deleted file mode 100644 index 29027794..00000000 --- a/docs/models/operations/GetTransientTokenResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTransientTokenResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetTransientTokenErrors](../../models/operations/GetTransientTokenErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetUpdateStatusResponse.md b/docs/models/operations/GetUpdateStatusResponse.md index 927b43b8..1418f575 100644 --- a/docs/models/operations/GetUpdateStatusResponse.md +++ b/docs/models/operations/GetUpdateStatusResponse.md @@ -3,10 +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 | -| `twoHundredApplicationJsonObject` | [Optional](../../models/operations/GetUpdateStatusResponseBody.md) | :heavy_minus_sign: | The Server Updates | -| `fourHundredAndOneApplicationJsonObject` | [Optional](../../models/operations/GetUpdateStatusUpdaterResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/GetUpdateStatusUpdaterResponseBody.md b/docs/models/operations/GetUpdateStatusUpdaterResponseBody.md deleted file mode 100644 index 47f91a6c..00000000 --- a/docs/models/operations/GetUpdateStatusUpdaterResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetUpdateStatusUpdaterResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusErrors](../../models/operations/GetUpdateStatusErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetWatchlistRequest.md b/docs/models/operations/GetWatchlistRequest.md new file mode 100644 index 00000000..3893f314 --- /dev/null +++ b/docs/models/operations/GetWatchlistRequest.md @@ -0,0 +1,16 @@ +# GetWatchlistRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `filter` | [lukehagar.plexapi.plexapi.models.operations.PathParamFilter](../../models/operations/PathParamFilter.md) | :heavy_check_mark: | Filter | +| `sort` | *Optional* | :heavy_minus_sign: | In the format "field:dir". Available fields are "watchlistedAt" (Added At),
"titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).
"dir" can be "asc" or "desc"
| +| `libtype` | [Optional](../../models/operations/Libtype.md) | :heavy_minus_sign: | The type of library to filter. Can be "movie" or "show", or all if not present.
| +| `maxresults` | *Optional* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
| +| `includeCollections` | [Optional](../../models/operations/IncludeCollections.md) | :heavy_minus_sign: | include collections in the results
| +| `includeExternalMedia` | [Optional](../../models/operations/IncludeExternalMedia.md) | :heavy_minus_sign: | include external media in the results
| +| `xPlexToken` | *String* | :heavy_check_mark: | User Token | +| `xPlexContainerStart` | *Optional* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
| +| `xPlexContainerSize` | *Optional* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
| \ No newline at end of file diff --git a/docs/models/operations/GetWatchlistResponse.md b/docs/models/operations/GetWatchlistResponse.md new file mode 100644 index 00000000..a146a5be --- /dev/null +++ b/docs/models/operations/GetWatchlistResponse.md @@ -0,0 +1,11 @@ +# GetWatchlistResponse + + +## 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 diff --git a/docs/models/operations/GetWatchlistResponseBody.md b/docs/models/operations/GetWatchlistResponseBody.md new file mode 100644 index 00000000..e765110b --- /dev/null +++ b/docs/models/operations/GetWatchlistResponseBody.md @@ -0,0 +1,16 @@ +# GetWatchlistResponseBody + +Watchlist Data + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | +| `offset` | *Optional* | :heavy_minus_sign: | N/A | +| `totalSize` | *Optional* | :heavy_minus_sign: | N/A | +| `identifier` | *Optional* | :heavy_minus_sign: | N/A | +| `size` | *Optional* | :heavy_minus_sign: | N/A | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.Metadata](../../models/operations/Metadata.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/Hub.md b/docs/models/operations/Hub.md index b9dead96..fbcc7482 100644 --- a/docs/models/operations/Hub.md +++ b/docs/models/operations/Hub.md @@ -3,16 +3,16 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `hubKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/50768,65523,58188,57341,57302,57070 | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /playlists/all?type=15&sort=lastViewedAt:desc&playlistType=video,audio | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Recent Playlists | -| `type` | *Optional* | :heavy_minus_sign: | N/A | playlist | -| `hubIdentifier` | *Optional* | :heavy_minus_sign: | N/A | home.playlists | -| `context` | *Optional* | :heavy_minus_sign: | N/A | hub.home.playlists | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 6 | -| `more` | *Optional* | :heavy_minus_sign: | N/A | true | -| `style` | *Optional* | :heavy_minus_sign: | N/A | shelf | -| `promoted` | *Optional* | :heavy_minus_sign: | N/A | true | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsMetadata](../../models/operations/GetGlobalHubsMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"ratingKey": "57070",
"key": "/playlists/57070/items",
"guid": "com.plexapp.agents.none://9fee6c5b-3143-4923-813e-57bd0190056c",
"type": "playlist",
"title": "November Movie Day",
"titleSort": "Tracks",
"summary": "",
"smart": false,
"playlistType": "video",
"composite": "/playlists/57070/composite/1668787730",
"icon": "playlist://image.smart",
"viewCount": 2,
"lastViewedAt": 1668787732,
"duration": 16873000,
"leafCount": 3,
"addedAt": 1668779618,
"updatedAt": 1668787730
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `hubKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/50768,65523,58188,57341,57302,57070 | +| `key` | *Optional* | :heavy_minus_sign: | N/A | /playlists/all?type=15&sort=lastViewedAt:desc&playlistType=video,audio | +| `title` | *Optional* | :heavy_minus_sign: | N/A | Recent Playlists | +| `type` | *Optional* | :heavy_minus_sign: | N/A | playlist | +| `hubIdentifier` | *Optional* | :heavy_minus_sign: | N/A | home.playlists | +| `context` | *Optional* | :heavy_minus_sign: | N/A | hub.home.playlists | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 6 | +| `more` | *Optional* | :heavy_minus_sign: | N/A | true | +| `style` | *Optional* | :heavy_minus_sign: | N/A | shelf | +| `promoted` | *Optional* | :heavy_minus_sign: | N/A | true | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsMetadata](../../models/operations/GetGlobalHubsMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/Image.md b/docs/models/operations/Image.md new file mode 100644 index 00000000..c4f6f795 --- /dev/null +++ b/docs/models/operations/Image.md @@ -0,0 +1,10 @@ +# Image + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `alt` | *Optional* | :heavy_minus_sign: | N/A | +| `type` | *Optional* | :heavy_minus_sign: | N/A | +| `url` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/IncludeCollections.md b/docs/models/operations/IncludeCollections.md new file mode 100644 index 00000000..cc248dfa --- /dev/null +++ b/docs/models/operations/IncludeCollections.md @@ -0,0 +1,12 @@ +# IncludeCollections + +include collections in the results + + + +## Values + +| Name | Value | +| ------ | ------ | +| `ONE` | 1 | +| `ZERO` | 0 | \ No newline at end of file diff --git a/docs/models/operations/IncludeExternalMedia.md b/docs/models/operations/IncludeExternalMedia.md new file mode 100644 index 00000000..07bbeab2 --- /dev/null +++ b/docs/models/operations/IncludeExternalMedia.md @@ -0,0 +1,12 @@ +# IncludeExternalMedia + +include external media in the results + + + +## Values + +| Name | Value | +| ------ | ------ | +| `ONE` | 1 | +| `ZERO` | 0 | \ No newline at end of file diff --git a/docs/models/operations/LibrarySectionID.md b/docs/models/operations/LibrarySectionID.md new file mode 100644 index 00000000..51c90cc6 --- /dev/null +++ b/docs/models/operations/LibrarySectionID.md @@ -0,0 +1,2 @@ +# LibrarySectionID + diff --git a/docs/models/operations/Libtype.md b/docs/models/operations/Libtype.md new file mode 100644 index 00000000..6828dfdc --- /dev/null +++ b/docs/models/operations/Libtype.md @@ -0,0 +1,12 @@ +# Libtype + +The type of library to filter. Can be "movie" or "show", or all if not present. + + + +## Values + +| Name | Value | +| ------- | ------- | +| `MOVIE` | movie | +| `SHOW` | show | \ No newline at end of file diff --git a/docs/models/operations/Location.md b/docs/models/operations/Location.md index 3775ea15..498b484f 100644 --- a/docs/models/operations/Location.md +++ b/docs/models/operations/Location.md @@ -11,7 +11,7 @@ | `country` | *Optional* | :heavy_minus_sign: | N/A | United States | | `city` | *Optional* | :heavy_minus_sign: | N/A | Austin | | `timeZone` | *Optional* | :heavy_minus_sign: | N/A | America/Chicago | -| `postalCode` | *Optional* | :heavy_minus_sign: | N/A | 78732 | +| `postalCode` | *Optional* | :heavy_minus_sign: | N/A | 78732 | | `inPrivacyRestrictedCountry` | *Optional* | :heavy_minus_sign: | N/A | | | `subdivisions` | *Optional* | :heavy_minus_sign: | N/A | Texas | | `coordinates` | *Optional* | :heavy_minus_sign: | N/A | 30.3768 -97.8935 | \ No newline at end of file diff --git a/docs/models/operations/LogLineResponse.md b/docs/models/operations/LogLineResponse.md index 5c007b69..da2fe3f4 100644 --- a/docs/models/operations/LogLineResponse.md +++ b/docs/models/operations/LogLineResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/LogLineResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/LogLineResponseBody.md b/docs/models/operations/LogLineResponseBody.md deleted file mode 100644 index 7ddb8781..00000000 --- a/docs/models/operations/LogLineResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# LogLineResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.LogLineErrors](../../models/operations/LogLineErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/LogMultiLineResponse.md b/docs/models/operations/LogMultiLineResponse.md index f1be9d3b..f9a76c07 100644 --- a/docs/models/operations/LogMultiLineResponse.md +++ b/docs/models/operations/LogMultiLineResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/LogMultiLineResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/LogMultiLineResponseBody.md b/docs/models/operations/LogMultiLineResponseBody.md deleted file mode 100644 index e7fac304..00000000 --- a/docs/models/operations/LogMultiLineResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# LogMultiLineResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.LogMultiLineErrors](../../models/operations/LogMultiLineErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/MarkPlayedResponse.md b/docs/models/operations/MarkPlayedResponse.md index 6b249cca..5f683859 100644 --- a/docs/models/operations/MarkPlayedResponse.md +++ b/docs/models/operations/MarkPlayedResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/MarkPlayedResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/MarkPlayedResponseBody.md b/docs/models/operations/MarkPlayedResponseBody.md deleted file mode 100644 index 6057f113..00000000 --- a/docs/models/operations/MarkPlayedResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# MarkPlayedResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.MarkPlayedErrors](../../models/operations/MarkPlayedErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/MarkUnplayedResponse.md b/docs/models/operations/MarkUnplayedResponse.md index 8e46baac..7423891a 100644 --- a/docs/models/operations/MarkUnplayedResponse.md +++ b/docs/models/operations/MarkUnplayedResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/MarkUnplayedResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/MarkUnplayedResponseBody.md b/docs/models/operations/MarkUnplayedResponseBody.md deleted file mode 100644 index 7e4800b7..00000000 --- a/docs/models/operations/MarkUnplayedResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# MarkUnplayedResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.MarkUnplayedErrors](../../models/operations/MarkUnplayedErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/Metadata.md b/docs/models/operations/Metadata.md index 6bc34bb4..842130b8 100644 --- a/docs/models/operations/Metadata.md +++ b/docs/models/operations/Metadata.md @@ -3,37 +3,40 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | | -| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | -| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 59398 | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/59398 | -| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5e161a83bea6ac004126e148 | -| `studio` | *Optional* | :heavy_minus_sign: | N/A | Marvel Studios | -| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Ant-Man and the Wasp: Quantumania | -| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | -| `summary` | *Optional* | :heavy_minus_sign: | N/A | Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible. | -| `rating` | *Optional* | :heavy_minus_sign: | N/A | 4.7 | -| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 8.3 | -| `year` | *Optional* | :heavy_minus_sign: | N/A | 2023 | -| `tagline` | *Optional* | :heavy_minus_sign: | N/A | Witness the beginning of a new dynasty. | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/59398/thumb/1681888010 | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/59398/art/1681888010 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 7474422 | -| `originallyAvailableAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | 2023-02-15 00:00:00 +0000 UTC | -| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1681803215 | -| `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1681888010 | -| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | -| `chapterSource` | *Optional* | :heavy_minus_sign: | N/A | media | -| `primaryExtraKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/59399 | -| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.rotten | -| `media` | List<[lukehagar.plexapi.plexapi.models.operations.Media](../../models/operations/Media.md)> | :heavy_minus_sign: | N/A | | -| `genre` | List<[lukehagar.plexapi.plexapi.models.operations.Genre](../../models/operations/Genre.md)> | :heavy_minus_sign: | N/A | | -| `director` | List<[lukehagar.plexapi.plexapi.models.operations.Director](../../models/operations/Director.md)> | :heavy_minus_sign: | N/A | | -| `writer` | List<[lukehagar.plexapi.plexapi.models.operations.Writer](../../models/operations/Writer.md)> | :heavy_minus_sign: | N/A | | -| `country` | List<[lukehagar.plexapi.plexapi.models.operations.Country](../../models/operations/Country.md)> | :heavy_minus_sign: | N/A | | -| `role` | List<[lukehagar.plexapi.plexapi.models.operations.Role](../../models/operations/Role.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `art` | *Optional* | :heavy_minus_sign: | N/A | +| `guid` | *Optional* | :heavy_minus_sign: | N/A | +| `key` | *Optional* | :heavy_minus_sign: | N/A | +| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | +| `studio` | *Optional* | :heavy_minus_sign: | N/A | +| `tagline` | *Optional* | :heavy_minus_sign: | N/A | +| `type` | *Optional* | :heavy_minus_sign: | N/A | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | +| `addedAt` | *Optional* | :heavy_minus_sign: | N/A | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | +| `publicPagesURL` | *Optional* | :heavy_minus_sign: | N/A | +| `slug` | *Optional* | :heavy_minus_sign: | N/A | +| `userState` | *Optional* | :heavy_minus_sign: | N/A | +| `title` | *Optional* | :heavy_minus_sign: | N/A | +| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | +| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | +| `year` | *Optional* | :heavy_minus_sign: | N/A | +| `image` | List<[lukehagar.plexapi.plexapi.models.operations.Image](../../models/operations/Image.md)> | :heavy_minus_sign: | N/A | +| `banner` | *Optional* | :heavy_minus_sign: | N/A | +| `rating` | *Optional* | :heavy_minus_sign: | N/A | +| `expiresAt` | *Optional* | :heavy_minus_sign: | N/A | +| `originalTitle` | *Optional* | :heavy_minus_sign: | N/A | +| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | +| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | +| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | +| `imdbRatingCount` | *Optional* | :heavy_minus_sign: | N/A | +| `subtype` | *Optional* | :heavy_minus_sign: | N/A | +| `theme` | *Optional* | :heavy_minus_sign: | N/A | +| `leafCount` | *Optional* | :heavy_minus_sign: | N/A | +| `childCount` | *Optional* | :heavy_minus_sign: | N/A | +| `isContinuingSeries` | *Optional* | :heavy_minus_sign: | N/A | +| `skipChildren` | *Optional* | :heavy_minus_sign: | N/A | +| `availabilityId` | *Optional* | :heavy_minus_sign: | N/A | +| `streamingMediaId` | *Optional* | :heavy_minus_sign: | N/A | +| `playableKey` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/PathParamFilter.md b/docs/models/operations/PathParamFilter.md new file mode 100644 index 00000000..f3d9441b --- /dev/null +++ b/docs/models/operations/PathParamFilter.md @@ -0,0 +1,12 @@ +# PathParamFilter + +Filter + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `ALL` | all | +| `AVAILABLE` | available | +| `RELEASED` | released | \ No newline at end of file diff --git a/docs/models/operations/PerformSearchResponse.md b/docs/models/operations/PerformSearchResponse.md index 3ecd7ecf..9ced937c 100644 --- a/docs/models/operations/PerformSearchResponse.md +++ b/docs/models/operations/PerformSearchResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/PerformSearchResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/PerformSearchResponseBody.md b/docs/models/operations/PerformSearchResponseBody.md deleted file mode 100644 index 67bf4c74..00000000 --- a/docs/models/operations/PerformSearchResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# PerformSearchResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.PerformSearchErrors](../../models/operations/PerformSearchErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/PerformVoiceSearchResponse.md b/docs/models/operations/PerformVoiceSearchResponse.md index c755869a..3e533d5e 100644 --- a/docs/models/operations/PerformVoiceSearchResponse.md +++ b/docs/models/operations/PerformVoiceSearchResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/PerformVoiceSearchResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/RefreshLibraryResponse.md b/docs/models/operations/RefreshLibraryResponse.md index a0950613..5464acc9 100644 --- a/docs/models/operations/RefreshLibraryResponse.md +++ b/docs/models/operations/RefreshLibraryResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/RefreshLibraryResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/RefreshLibraryResponseBody.md b/docs/models/operations/RefreshLibraryResponseBody.md deleted file mode 100644 index 7a77b69c..00000000 --- a/docs/models/operations/RefreshLibraryResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# RefreshLibraryResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.RefreshLibraryErrors](../../models/operations/RefreshLibraryErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/SearchLibraryMediaContainer.md b/docs/models/operations/SearchLibraryMediaContainer.md index 83ab307a..551b963d 100644 --- a/docs/models/operations/SearchLibraryMediaContainer.md +++ b/docs/models/operations/SearchLibraryMediaContainer.md @@ -3,18 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 2 | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | false | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/show-fanart.jpg | -| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1698860922 | -| `nocache` | *Optional* | :heavy_minus_sign: | N/A | true | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/show.png | -| `title1` | *Optional* | :heavy_minus_sign: | N/A | TV Shows | -| `title2` | *Optional* | :heavy_minus_sign: | N/A | Search for '' | -| `viewGroup` | *Optional* | :heavy_minus_sign: | N/A | season | -| `viewMode` | *Optional* | :heavy_minus_sign: | N/A | 65593 | -| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.SearchLibraryMetadata](../../models/operations/SearchLibraryMetadata.md)> | :heavy_minus_sign: | N/A | [
{
"ratingKey": "2",
"key": "/library/metadata/2/children",
"parentRatingKey": "1",
"guid": "plex://season/602e67e766dfdb002c0a1b5b",
"parentGuid": "plex://show/5d9c086c7d06d9001ffd27aa",
"parentStudio": "Mutant Enemy Productions",
"type": "season",
"title": "Season 1",
"parentKey": "/library/metadata/1",
"parentTitle": "Firefly",
"summary": "Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is the captain of the transport ship \"Serenity\". Mal and his crew, ensign Zoe Alleyne Washburne; Zoe's husband, pilot Hoban 'Wash' Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee Frye; former Alliance medical officer Simon Tam; his disturbed teenage sister River (both on the run from the interplanetary government \"The Alliance\"); the beautiful courtesan Inara Serra; and preacher Shepherd Book do any jobs, legal or illegal, they can find as the Serenity crew travels across the outskirts of outer space.",
"index": 1,
"parentIndex": 1,
"parentYear": 2002,
"thumb": "/library/metadata/2/thumb/1705636920",
"art": "/library/metadata/1/art/1705636920",
"parentThumb": "/library/metadata/1/thumb/1705636920",
"parentTheme": "/library/metadata/1/theme/1705636920",
"addedAt": 1705636916,
"updatedAt": 1705636920
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `size` | *Optional* | :heavy_minus_sign: | N/A | 2 | +| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | false | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/show-fanart.jpg | +| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1698860922 | +| `nocache` | *Optional* | :heavy_minus_sign: | N/A | true | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/show.png | +| `title1` | *Optional* | :heavy_minus_sign: | N/A | TV Shows | +| `title2` | *Optional* | :heavy_minus_sign: | N/A | Search for '' | +| `viewGroup` | *Optional* | :heavy_minus_sign: | N/A | season | +| `viewMode` | *Optional* | :heavy_minus_sign: | N/A | 65593 | +| `metadata` | List<[lukehagar.plexapi.plexapi.models.operations.SearchLibraryMetadata](../../models/operations/SearchLibraryMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/StartAllTasksResponse.md b/docs/models/operations/StartAllTasksResponse.md index eb0b1a94..68d73133 100644 --- a/docs/models/operations/StartAllTasksResponse.md +++ b/docs/models/operations/StartAllTasksResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/StartAllTasksResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/StartAllTasksResponseBody.md b/docs/models/operations/StartAllTasksResponseBody.md deleted file mode 100644 index 07022af3..00000000 --- a/docs/models/operations/StartAllTasksResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# StartAllTasksResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.StartAllTasksErrors](../../models/operations/StartAllTasksErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/StartTaskResponse.md b/docs/models/operations/StartTaskResponse.md index 25cace1a..c0d712bb 100644 --- a/docs/models/operations/StartTaskResponse.md +++ b/docs/models/operations/StartTaskResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/StartTaskResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/StartTaskResponseBody.md b/docs/models/operations/StartTaskResponseBody.md deleted file mode 100644 index 32d42daa..00000000 --- a/docs/models/operations/StartTaskResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# StartTaskResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.StartTaskErrors](../../models/operations/StartTaskErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/StartUniversalTranscodeRequest.md b/docs/models/operations/StartUniversalTranscodeRequest.md index 4c07f461..8a576da3 100644 --- a/docs/models/operations/StartUniversalTranscodeRequest.md +++ b/docs/models/operations/StartUniversalTranscodeRequest.md @@ -3,21 +3,21 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `hasMDE` | *double* | :heavy_check_mark: | Whether the media item has MDE | -| `path` | *String* | :heavy_check_mark: | The path to the media item to transcode | -| `mediaIndex` | *double* | :heavy_check_mark: | The index of the media item to transcode | -| `partIndex` | *double* | :heavy_check_mark: | The index of the part to transcode | -| `protocol` | *String* | :heavy_check_mark: | The protocol to use for the transcode session | -| `fastSeek` | *Optional* | :heavy_minus_sign: | Whether to use fast seek or not | -| `directPlay` | *Optional* | :heavy_minus_sign: | Whether to use direct play or not | -| `directStream` | *Optional* | :heavy_minus_sign: | Whether to use direct stream or not | -| `subtitleSize` | *Optional* | :heavy_minus_sign: | The size of the subtitles | -| `subtites` | *Optional* | :heavy_minus_sign: | The subtitles | -| `audioBoost` | *Optional* | :heavy_minus_sign: | The audio boost | -| `location` | *Optional* | :heavy_minus_sign: | The location of the transcode session | -| `mediaBufferSize` | *Optional* | :heavy_minus_sign: | The size of the media buffer | -| `session` | *Optional* | :heavy_minus_sign: | The session ID | -| `addDebugOverlay` | *Optional* | :heavy_minus_sign: | Whether to add a debug overlay or not | -| `autoAdjustQuality` | *Optional* | :heavy_minus_sign: | Whether to auto adjust quality or not | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `hasMDE` | *double* | :heavy_check_mark: | Whether the media item has MDE | 1 | +| `path` | *String* | :heavy_check_mark: | The path to the media item to transcode | /library/metadata/23409 | +| `mediaIndex` | *double* | :heavy_check_mark: | The index of the media item to transcode | 0 | +| `partIndex` | *double* | :heavy_check_mark: | The index of the part to transcode | 0 | +| `protocol` | *String* | :heavy_check_mark: | The protocol to use for the transcode session | hls | +| `fastSeek` | *Optional* | :heavy_minus_sign: | Whether to use fast seek or not | 0 | +| `directPlay` | *Optional* | :heavy_minus_sign: | Whether to use direct play or not | 0 | +| `directStream` | *Optional* | :heavy_minus_sign: | Whether to use direct stream or not | 0 | +| `subtitleSize` | *Optional* | :heavy_minus_sign: | The size of the subtitles | 100 | +| `subtites` | *Optional* | :heavy_minus_sign: | The subtitles | burn | +| `audioBoost` | *Optional* | :heavy_minus_sign: | The audio boost | 100 | +| `location` | *Optional* | :heavy_minus_sign: | The location of the transcode session | lan | +| `mediaBufferSize` | *Optional* | :heavy_minus_sign: | The size of the media buffer | 102400 | +| `session` | *Optional* | :heavy_minus_sign: | The session ID | zvcage8b7rkioqcm8f4uns4c | +| `addDebugOverlay` | *Optional* | :heavy_minus_sign: | Whether to add a debug overlay or not | 0 | +| `autoAdjustQuality` | *Optional* | :heavy_minus_sign: | Whether to auto adjust quality or not | 0 | \ No newline at end of file diff --git a/docs/models/operations/StartUniversalTranscodeResponse.md b/docs/models/operations/StartUniversalTranscodeResponse.md index e84f1dfa..430ea62a 100644 --- a/docs/models/operations/StartUniversalTranscodeResponse.md +++ b/docs/models/operations/StartUniversalTranscodeResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/StartUniversalTranscodeResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/StartUniversalTranscodeResponseBody.md b/docs/models/operations/StartUniversalTranscodeResponseBody.md deleted file mode 100644 index cd9790ea..00000000 --- a/docs/models/operations/StartUniversalTranscodeResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# StartUniversalTranscodeResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeErrors](../../models/operations/StartUniversalTranscodeErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/StatisticsBandwidth.md b/docs/models/operations/StatisticsBandwidth.md new file mode 100644 index 00000000..a0003aa7 --- /dev/null +++ b/docs/models/operations/StatisticsBandwidth.md @@ -0,0 +1,13 @@ +# StatisticsBandwidth + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `accountID` | *Optional* | :heavy_minus_sign: | N/A | 238960586 | +| `deviceID` | *Optional* | :heavy_minus_sign: | N/A | | +| `timespan` | *Optional* | :heavy_minus_sign: | N/A | 6 | +| `at` | *Optional* | :heavy_minus_sign: | N/A | 1718387650 | +| `lan` | *Optional* | :heavy_minus_sign: | N/A | true | +| `bytes` | *Optional* | :heavy_minus_sign: | N/A | 22 | \ No newline at end of file diff --git a/docs/models/operations/StatisticsResources.md b/docs/models/operations/StatisticsResources.md new file mode 100644 index 00000000..1df45d99 --- /dev/null +++ b/docs/models/operations/StatisticsResources.md @@ -0,0 +1,13 @@ +# StatisticsResources + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `timespan` | *Optional* | :heavy_minus_sign: | N/A | 6 | +| `at` | *Optional* | :heavy_minus_sign: | N/A | 1718384427 | +| `hostCpuUtilization` | *Optional* | :heavy_minus_sign: | N/A | 1.276 | +| `processCpuUtilization` | *Optional* | :heavy_minus_sign: | N/A | 0.025 | +| `hostMemoryUtilization` | *Optional* | :heavy_minus_sign: | N/A | 17.026 | +| `processMemoryUtilization` | *Optional* | :heavy_minus_sign: | N/A | 0.493 | \ No newline at end of file diff --git a/docs/models/operations/StopAllTasksResponse.md b/docs/models/operations/StopAllTasksResponse.md index 97e367fc..bb33806e 100644 --- a/docs/models/operations/StopAllTasksResponse.md +++ b/docs/models/operations/StopAllTasksResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/StopAllTasksResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/StopAllTasksResponseBody.md b/docs/models/operations/StopAllTasksResponseBody.md deleted file mode 100644 index 2f2b1007..00000000 --- a/docs/models/operations/StopAllTasksResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# StopAllTasksResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.StopAllTasksErrors](../../models/operations/StopAllTasksErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/StopTaskResponse.md b/docs/models/operations/StopTaskResponse.md index 09dae435..9d43a4eb 100644 --- a/docs/models/operations/StopTaskResponse.md +++ b/docs/models/operations/StopTaskResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/StopTaskResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/StopTaskResponseBody.md b/docs/models/operations/StopTaskResponseBody.md deleted file mode 100644 index 6f36f78e..00000000 --- a/docs/models/operations/StopTaskResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# StopTaskResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.StopTaskErrors](../../models/operations/StopTaskErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/StopTranscodeSessionResponse.md b/docs/models/operations/StopTranscodeSessionResponse.md index 2d0dd858..17de4d9c 100644 --- a/docs/models/operations/StopTranscodeSessionResponse.md +++ b/docs/models/operations/StopTranscodeSessionResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/StopTranscodeSessionResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/StopTranscodeSessionResponseBody.md b/docs/models/operations/StopTranscodeSessionResponseBody.md deleted file mode 100644 index 596baa18..00000000 --- a/docs/models/operations/StopTranscodeSessionResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# StopTranscodeSessionResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionErrors](../../models/operations/StopTranscodeSessionErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdatePlayProgressRequest.md b/docs/models/operations/UpdatePlayProgressRequest.md index 9a66f8f9..e8095bff 100644 --- a/docs/models/operations/UpdatePlayProgressRequest.md +++ b/docs/models/operations/UpdatePlayProgressRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `key` | *String* | :heavy_check_mark: | the media key | -| `time` | *double* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | -| `state` | *String* | :heavy_check_mark: | The playback state of the media item. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `key` | *String* | :heavy_check_mark: | the media key | | +| `time` | *double* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 | +| `state` | *String* | :heavy_check_mark: | The playback state of the media item. | played | \ No newline at end of file diff --git a/docs/models/operations/UpdatePlayProgressResponse.md b/docs/models/operations/UpdatePlayProgressResponse.md index 3152f9f9..fb6658fe 100644 --- a/docs/models/operations/UpdatePlayProgressResponse.md +++ b/docs/models/operations/UpdatePlayProgressResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/UpdatePlayProgressResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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 7e166c81..ff347431 100644 --- a/docs/models/operations/UpdatePlaylistResponse.md +++ b/docs/models/operations/UpdatePlaylistResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/UpdatePlaylistResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/UpdatePlaylistResponseBody.md b/docs/models/operations/UpdatePlaylistResponseBody.md deleted file mode 100644 index 2eaaa256..00000000 --- a/docs/models/operations/UpdatePlaylistResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdatePlaylistResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistErrors](../../models/operations/UpdatePlaylistErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UploadPlaylistResponse.md b/docs/models/operations/UploadPlaylistResponse.md index f3f414b9..08d49554 100644 --- a/docs/models/operations/UploadPlaylistResponse.md +++ b/docs/models/operations/UploadPlaylistResponse.md @@ -3,9 +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 | -| `object` | [Optional](../../models/operations/UploadPlaylistResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ 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/UploadPlaylistResponseBody.md b/docs/models/operations/UploadPlaylistResponseBody.md deleted file mode 100644 index 128ca61d..00000000 --- a/docs/models/operations/UploadPlaylistResponseBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# UploadPlaylistResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `errors` | List<[lukehagar.plexapi.plexapi.models.operations.UploadPlaylistErrors](../../models/operations/UploadPlaylistErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/User.md b/docs/models/operations/User.md index ea240269..7ee912c7 100644 --- a/docs/models/operations/User.md +++ b/docs/models/operations/User.md @@ -3,8 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `id` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | https://plex.tv/users/844780fc6f8a26b5/avatar?c=1705853661 | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Blindkitty38 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | 220 | \ No newline at end of file diff --git a/src/main/java/lukehagar/plexapi/plexapi/Activities.java b/src/main/java/lukehagar/plexapi/plexapi/Activities.java index 41dae91b..070749e0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Activities.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Activities.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.openapitools.jackson.nullable.JsonNullable; @@ -40,6 +45,12 @@ public class Activities implements this.sdkConfiguration = sdkConfiguration; } + + /** + * Get Server Activities + * Get Server Activities + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesRequestBuilder getServerActivities() { return new lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesRequestBuilder(this); } @@ -47,72 +58,117 @@ public class Activities implements /** * Get Server Activities * Get Server Activities - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse getServerActivitiesDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/activities"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesActivitiesResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetServerActivitiesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Cancel Server Activities + * Cancel Server Activities + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesRequestBuilder cancelServerActivities() { return new lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesRequestBuilder(this); } @@ -121,8 +177,8 @@ public class Activities implements * Cancel Server Activities * Cancel Server Activities * @param activityUUID The UUID of the activity to cancel. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse cancelServerActivities( String activityUUID) throws Exception { @@ -132,57 +188,95 @@ public class Activities implements .activityUUID(activityUUID) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesRequest.class, - baseUrl, + _baseUrl, "/activities/{activityUUID}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("DELETE"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("cancelServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("cancelServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("cancelServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("cancelServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.CancelServerActivitiesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Authentication.java b/src/main/java/lukehagar/plexapi/plexapi/Authentication.java index 18b4d423..09fb0068 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Authentication.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Authentication.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -35,6 +40,13 @@ public class Authentication implements this.sdkConfiguration = 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. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetTransientTokenRequestBuilder getTransientToken() { return new lukehagar.plexapi.plexapi.models.operations.GetTransientTokenRequestBuilder(this); } @@ -45,8 +57,8 @@ public class Authentication implements * * @param type `delegation` - This is the only supported `type` parameter. * @param scope `all` - This is the only supported `scope` parameter. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse getTransientToken( lukehagar.plexapi.plexapi.models.operations.GetTransientTokenQueryParamType type, @@ -58,66 +70,109 @@ public class Authentication implements .scope(scope) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/security/token"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetTransientTokenRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetTransientTokenRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getTransientToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getTransientToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getTransientToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getTransientToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetTransientTokenResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequestBuilder getSourceConnectionInformation() { return new lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequestBuilder(this); } @@ -128,8 +183,8 @@ public class Authentication implements * Note: requires Plex Media Server >= 1.15.4. * * @param source The source identifier with an included prefix. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse getSourceConnectionInformation( String source) throws Exception { @@ -139,63 +194,98 @@ public class Authentication implements .source(source) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/security/resources"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getSourceConnectionInformation", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getSourceConnectionInformation", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getSourceConnectionInformation", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getSourceConnectionInformation", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetSourceConnectionInformationResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Butler.java b/src/main/java/lukehagar/plexapi/plexapi/Butler.java index 4f12d058..0665fb65 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Butler.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Butler.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.openapitools.jackson.nullable.JsonNullable; @@ -37,6 +42,12 @@ public class Butler implements this.sdkConfiguration = sdkConfiguration; } + + /** + * Get Butler tasks + * Returns a list of butler tasks + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetButlerTasksRequestBuilder getButlerTasks() { return new lukehagar.plexapi.plexapi.models.operations.GetButlerTasksRequestBuilder(this); } @@ -44,72 +55,122 @@ public class Butler implements /** * Get Butler tasks * Returns a list of butler tasks - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse getButlerTasksDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/butler"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getButlerTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getButlerTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getButlerTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getButlerTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetButlerTasksButlerResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetButlerTasksResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.StartAllTasksRequestBuilder startAllTasks() { return new lukehagar.plexapi.plexapi.models.operations.StartAllTasksRequestBuilder(this); } @@ -122,62 +183,107 @@ public class Butler implements * 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 response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse startAllTasksDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/butler"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("POST"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("startAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("startAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("startAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("startAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.StartAllTasksResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Stop all Butler tasks + * This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.StopAllTasksRequestBuilder stopAllTasks() { return new lukehagar.plexapi.plexapi.models.operations.StopAllTasksRequestBuilder(this); } @@ -186,62 +292,111 @@ public class Butler implements * Stop all Butler tasks * This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. * - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse stopAllTasksDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/butler"); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("DELETE"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("stopAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("stopAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("stopAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("stopAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.StopAllTasksResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.StartTaskRequestBuilder startTask() { return new lukehagar.plexapi.plexapi.models.operations.StartTaskRequestBuilder(this); } @@ -255,8 +410,8 @@ public class Butler implements * 4. If we are outside the configured window, the task will start immediately. * * @param taskName the name of the task to be started. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.StartTaskResponse startTask( lukehagar.plexapi.plexapi.models.operations.TaskName taskName) throws Exception { @@ -266,60 +421,105 @@ public class Butler implements .taskName(taskName) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.StartTaskRequest.class, - baseUrl, + _baseUrl, "/butler/{taskName}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("POST"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("startTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("startTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("startTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("startTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.StartTaskResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.StartTaskResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.StartTaskResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.StartTaskResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 202 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.StartTaskResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.StartTaskResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200", "202")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.StartTaskResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.StopTaskRequestBuilder stopTask() { return new lukehagar.plexapi.plexapi.models.operations.StopTaskRequestBuilder(this); } @@ -329,8 +529,8 @@ public class Butler implements * 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 The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.StopTaskResponse stopTask( lukehagar.plexapi.plexapi.models.operations.PathParamTaskName taskName) throws Exception { @@ -340,57 +540,95 @@ public class Butler implements .taskName(taskName) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.StopTaskRequest.class, - baseUrl, + _baseUrl, "/butler/{taskName}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("DELETE"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("stopTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("stopTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("stopTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("stopTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.StopTaskResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.StopTaskResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.StopTaskResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.StopTaskResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400 || httpRes.statusCode() == 404) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.StopTaskResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.StopTaskResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.StopTaskResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Hubs.java b/src/main/java/lukehagar/plexapi/plexapi/Hubs.java index 9eb4947b..6c60d2eb 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Hubs.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Hubs.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -35,17 +40,32 @@ public class Hubs implements this.sdkConfiguration = sdkConfiguration; } + + /** + * Get Global Hubs + * Get Global Hubs filtered by the parameters provided. + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsRequestBuilder getGlobalHubs() { return new lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsRequestBuilder(this); } + /** + * Get Global Hubs + * Get Global Hubs filtered by the parameters provided. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse getGlobalHubsDirect() throws Exception { + 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 The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse getGlobalHubs( Optional count, @@ -57,80 +77,135 @@ public class Hubs implements .onlyTransient(onlyTransient) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/hubs"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getGlobalHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getGlobalHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getGlobalHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getGlobalHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsHubsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetGlobalHubsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get library specific hubs + * This endpoint will return a list of library specific hubs + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequestBuilder getLibraryHubs() { return new lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequestBuilder(this); } + /** + * Get library specific hubs + * This endpoint will return a list of library specific hubs + * + * @param sectionId the Id of the library to query + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse getLibraryHubs( + double sectionId) throws Exception { + return getLibraryHubs(sectionId, Optional.empty(), Optional.empty()); + } /** * Get library specific hubs * This endpoint will return a list of library specific hubs @@ -138,8 +213,8 @@ public class Hubs implements * @param sectionId the Id of the library to query * @param count The number of items to return with each hub. * @param onlyTransient Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse getLibraryHubs( double sectionId, @@ -153,75 +228,111 @@ public class Hubs implements .onlyTransient(onlyTransient) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequest.class, - baseUrl, + _baseUrl, "/hubs/sections/{sectionId}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getLibraryHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getLibraryHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getLibraryHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getLibraryHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsHubsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetLibraryHubsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Library.java b/src/main/java/lukehagar/plexapi/plexapi/Library.java index c8c4d92a..4f3a1e9b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Library.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Library.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -36,6 +41,7 @@ public class Library implements MethodCallSearchLibrary, MethodCallGetMetadata, MethodCallGetMetadataChildren, + MethodCallGetTopWatchedContent, MethodCallGetOnDeck { private final SDKConfiguration sdkConfiguration; @@ -44,17 +50,34 @@ public class Library implements this.sdkConfiguration = sdkConfiguration; } + + /** + * Get Hash Value + * This resource returns hash values for local files + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetFileHashRequestBuilder getFileHash() { return new lukehagar.plexapi.plexapi.models.operations.GetFileHashRequestBuilder(this); } + /** + * 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 The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetFileHashResponse getFileHash( + String url) throws Exception { + 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 The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetFileHashResponse getFileHash( String url, @@ -66,66 +89,108 @@ public class Library implements .type(type) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/library/hashes"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetFileHashRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetFileHashRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getFileHash", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getFileHash", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getFileHash", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getFileHash", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetFileHashResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetFileHashResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetFileHashResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetFileHashResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetFileHashResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.GetFileHashResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetFileHashResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Recently Added + * This endpoint will return the recently added content. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedRequestBuilder getRecentlyAdded() { return new lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedRequestBuilder(this); } @@ -134,72 +199,123 @@ public class Library implements * Get Recently Added * This endpoint will return the recently added content. * - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedResponse getRecentlyAddedDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/library/recentlyAdded"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getRecentlyAdded", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getRecentlyAdded", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getRecentlyAdded", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getRecentlyAdded", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedLibraryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetRecentlyAddedResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetLibrariesRequestBuilder getLibraries() { return new lukehagar.plexapi.plexapi.models.operations.GetLibrariesRequestBuilder(this); } @@ -213,76 +329,210 @@ public class Library implements * 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 response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetLibrariesResponse getLibrariesDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/library/sections"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getLibraries", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getLibraries", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getLibraries", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getLibraries", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetLibrariesResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetLibrariesResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetLibrariesResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetLibrariesResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetLibrariesResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetLibrariesResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetLibrariesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetLibrariesLibraryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetLibrariesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetLibraryRequestBuilder getLibrary() { return new lukehagar.plexapi.plexapi.models.operations.GetLibraryRequestBuilder(this); } + /** + * 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 sectionId the Id of the library to query + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetLibraryResponse getLibrary( + double sectionId) throws Exception { + return getLibrary(sectionId, Optional.empty()); + } /** * Get Library Details * ## Library Details Endpoint @@ -329,8 +579,8 @@ public class Library implements * @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. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetLibraryResponse getLibrary( double sectionId, @@ -342,78 +592,120 @@ public class Library implements .includeDetails(includeDetails) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.GetLibraryRequest.class, - baseUrl, + _baseUrl, "/library/sections/{sectionId}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetLibraryRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetLibraryRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetLibraryResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetLibraryResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetLibraryResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetLibraryResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetLibraryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetLibraryResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetLibraryResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetLibraryLibraryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetLibraryResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Delete Library Section + * Delate a library using a specific section + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.DeleteLibraryRequestBuilder deleteLibrary() { return new lukehagar.plexapi.plexapi.models.operations.DeleteLibraryRequestBuilder(this); } @@ -422,8 +714,8 @@ public class Library implements * Delete Library Section * Delate a library using a specific section * @param sectionId the Id of the library to query - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.DeleteLibraryResponse deleteLibrary( double sectionId) throws Exception { @@ -433,60 +725,124 @@ public class Library implements .sectionId(sectionId) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.DeleteLibraryRequest.class, - baseUrl, + _baseUrl, "/library/sections/{sectionId}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("DELETE"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("deleteLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("deleteLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("deleteLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("deleteLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.DeleteLibraryResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.DeleteLibraryResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.DeleteLibraryResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.DeleteLibraryResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.DeleteLibraryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.DeleteLibraryResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.DeleteLibraryResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsRequestBuilder getLibraryItems() { return new lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsRequestBuilder(this); } @@ -516,72 +872,171 @@ public class Library implements * * @param sectionId the Id of the library to query * @param tag A key representing a specific tag within the section. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponse getLibraryItems( - long sectionId, + java.lang.Object sectionId, lukehagar.plexapi.plexapi.models.operations.Tag tag) throws Exception { + return getLibraryItems(sectionId, tag, Optional.empty()); + } + /** + * Get Library Items + * Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values: + * - `all`: All items in the section. + * - `unwatched`: Items that have not been played. + * - `newest`: Items that are recently released. + * - `recentlyAdded`: Items that are recently added to the library. + * - `recentlyViewed`: Items that were recently viewed. + * - `onDeck`: Items to continue watching. + * - `collection`: Items categorized by collection. + * - `edition`: Items categorized by edition. + * - `genre`: Items categorized by genre. + * - `year`: Items categorized by year of release. + * - `decade`: Items categorized by decade. + * - `director`: Items categorized by director. + * - `actor`: Items categorized by starring actor. + * - `country`: Items categorized by country of origin. + * - `contentRating`: Items categorized by content rating. + * - `rating`: Items categorized by rating. + * - `resolution`: Items categorized by resolution. + * - `firstCharacter`: Items categorized by the first letter. + * - `folder`: Items categorized by folder. + * + * @param sectionId the Id of the library to query + * @param tag A key representing a specific tag within the section. + * @param includeGuids Adds the Guids object to the response + + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponse getLibraryItems( + java.lang.Object sectionId, + lukehagar.plexapi.plexapi.models.operations.Tag tag, + Optional includeGuids) throws Exception { lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsRequest request = lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsRequest .builder() .sectionId(sectionId) .tag(tag) + .includeGuids(includeGuids) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsRequest.class, - baseUrl, + _baseUrl, "/library/sections/{sectionId}/{tag}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getLibraryItems", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getLibraryItems", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getLibraryItems", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getLibraryItems", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetLibraryItemsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Refresh Library + * This endpoint Refreshes the library. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.RefreshLibraryRequestBuilder refreshLibrary() { return new lukehagar.plexapi.plexapi.models.operations.RefreshLibraryRequestBuilder(this); } @@ -591,8 +1046,8 @@ public class Library implements * This endpoint Refreshes the library. * * @param sectionId the Id of the library to refresh - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.RefreshLibraryResponse refreshLibrary( double sectionId) throws Exception { @@ -602,60 +1057,122 @@ public class Library implements .sectionId(sectionId) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.RefreshLibraryRequest.class, - baseUrl, + _baseUrl, "/library/sections/{sectionId}/refresh", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("refreshLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("refreshLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("refreshLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("refreshLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.RefreshLibraryResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.RefreshLibraryResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.RefreshLibraryResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.RefreshLibraryResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.RefreshLibraryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.RefreshLibraryResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.RefreshLibraryResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.SearchLibraryRequestBuilder searchLibrary() { return new lukehagar.plexapi.plexapi.models.operations.SearchLibraryRequestBuilder(this); } @@ -683,8 +1200,8 @@ public class Library implements * * @param sectionId the Id of the library to query * @param type Plex content type to search for - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.SearchLibraryResponse searchLibrary( long sectionId, @@ -696,67 +1213,121 @@ public class Library implements .type(type) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.SearchLibraryRequest.class, - baseUrl, + _baseUrl, "/library/sections/{sectionId}/search", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.SearchLibraryRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.SearchLibraryRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("searchLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("searchLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("searchLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("searchLibrary", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.SearchLibraryResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.SearchLibraryResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.SearchLibraryResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.SearchLibraryResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.SearchLibraryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.SearchLibraryResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.SearchLibraryResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.SearchLibraryResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Items Metadata + * This endpoint will return the metadata of a library item specified with the ratingKey. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetMetadataRequestBuilder getMetadata() { return new lukehagar.plexapi.plexapi.models.operations.GetMetadataRequestBuilder(this); } @@ -766,8 +1337,8 @@ public class Library implements * This endpoint will return the metadata of a library item specified with the ratingKey. * * @param ratingKey the id of the library item to return the children of. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetMetadataResponse getMetadata( double ratingKey) throws Exception { @@ -777,70 +1348,116 @@ public class Library implements .ratingKey(ratingKey) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.GetMetadataRequest.class, - baseUrl, + _baseUrl, "/library/metadata/{ratingKey}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getMetadata", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getMetadata", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getMetadata", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getMetadata", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetMetadataResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetMetadataResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetMetadataResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetMetadataResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetMetadataResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetMetadataResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetMetadataResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetMetadataLibraryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetMetadataResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Items Children + * This endpoint will return the children of of a library item specified with the ratingKey. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenRequestBuilder getMetadataChildren() { return new lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenRequestBuilder(this); } @@ -850,81 +1467,281 @@ public class Library implements * 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 The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponse getMetadataChildren( double ratingKey) throws Exception { + 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 The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponse getMetadataChildren( + double ratingKey, + Optional includeElements) throws Exception { lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenRequest request = lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenRequest .builder() .ratingKey(ratingKey) + .includeElements(includeElements) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenRequest.class, - baseUrl, + _baseUrl, "/library/metadata/{ratingKey}/children", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getMetadataChildren", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getMetadataChildren", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getMetadataChildren", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getMetadataChildren", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenLibraryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetMetadataChildrenResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Top Watched Content + * This endpoint will return the top watched content from libraries of a certain type + * + * @return The call builder + */ + public lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentRequestBuilder getTopWatchedContent() { + return new lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentRequestBuilder(this); + } + + /** + * Get Top Watched Content + * This endpoint will return the top watched content from libraries of a certain type + * + * @param type the library type (1 - movies, 2 - shows, 3 - music) + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentResponse getTopWatchedContent( + long type) throws Exception { + 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 library type (1 - movies, 2 - shows, 3 - music) + * @param includeGuids Adds the Guids object to the response + + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentResponse getTopWatchedContent( + long type, + Optional includeGuids) throws Exception { + lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentRequest request = + lukehagar.plexapi.plexapi.models.operations.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", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentRequest.class, + request, + this.sdkConfiguration.globals)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getTopWatchedContent", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getTopWatchedContent", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getTopWatchedContent", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getTopWatchedContent", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentResponse.Builder _resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Get On Deck + * This endpoint will return the on deck content. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetOnDeckRequestBuilder getOnDeck() { return new lukehagar.plexapi.plexapi.models.operations.GetOnDeckRequestBuilder(this); } @@ -933,69 +1750,108 @@ public class Library implements * Get On Deck * This endpoint will return the on deck content. * - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetOnDeckResponse getOnDeckDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/library/onDeck"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getOnDeck", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getOnDeck", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getOnDeck", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getOnDeck", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetOnDeckResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetOnDeckResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetOnDeckResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetOnDeckResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetOnDeckResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetOnDeckResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetOnDeckResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetOnDeckLibraryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetOnDeckResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Log.java b/src/main/java/lukehagar/plexapi/plexapi/Log.java index 2f100e02..ff04d575 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Log.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Log.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.SerializedBody; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; @@ -37,6 +42,13 @@ public class Log implements this.sdkConfiguration = 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. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.LogLineRequestBuilder logLine() { return new lukehagar.plexapi.plexapi.models.operations.LogLineRequestBuilder(this); } @@ -54,8 +66,8 @@ public class Log implements * @param message The text of the message to write to the log. * @param source a string indicating the source of the message. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.LogLineResponse logLine( lukehagar.plexapi.plexapi.models.operations.Level level, @@ -69,66 +81,128 @@ public class Log implements .source(source) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/log"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.LogLineRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.LogLineRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("logLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("logLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("logLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("logLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.LogLineResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.LogLineResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.LogLineResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.LogLineResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.LogLineResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.LogLineResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.LogLineResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.LogMultiLineRequestBuilder logMultiLine() { return new lukehagar.plexapi.plexapi.models.operations.LogMultiLineRequestBuilder(this); } @@ -158,71 +232,116 @@ 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. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse logMultiLine( String request) throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/log"); - - HTTPRequest req = new HTTPRequest(); - req.setMethod("POST"); - req.setURL(url); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, new TypeReference() {}); - SerializedBody serializedRequestBody = lukehagar.plexapi.plexapi.utils.Utils.serializeRequestBody( + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( _convertedRequest, "request", "string", false); - if (serializedRequestBody == null) { + if (_serializedRequestBody == null) { throw new Exception("Request body is required"); } - req.setBody(serializedRequestBody); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("logMultiLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("logMultiLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("logMultiLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("logMultiLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.LogMultiLineResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailRequestBuilder enablePaperTrail() { return new lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailRequestBuilder(this); } @@ -231,59 +350,97 @@ public class Log implements * 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 response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse enablePaperTrailDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/log/networked"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("enablePaperTrail", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("enablePaperTrail", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("enablePaperTrail", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("enablePaperTrail", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400 || httpRes.statusCode() == 403) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.EnablePaperTrailResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Media.java b/src/main/java/lukehagar/plexapi/plexapi/Media.java index f08a63de..3befc0e6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Media.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Media.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -36,6 +41,12 @@ public class Media implements this.sdkConfiguration = sdkConfiguration; } + + /** + * Mark Media Played + * This will mark the provided media key as Played. + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.MarkPlayedRequestBuilder markPlayed() { return new lukehagar.plexapi.plexapi.models.operations.MarkPlayedRequestBuilder(this); } @@ -44,8 +55,8 @@ public class Media implements * Mark Media Played * This will mark the provided media key as Played. * @param key The media key to mark as played - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse markPlayed( double key) throws Exception { @@ -55,66 +66,107 @@ public class Media implements .key(key) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/:/scrobble"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.MarkPlayedRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.MarkPlayedRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("markPlayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("markPlayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("markPlayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("markPlayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.MarkPlayedResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Mark Media Unplayed + * This will mark the provided media key as Unplayed. + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.MarkUnplayedRequestBuilder markUnplayed() { return new lukehagar.plexapi.plexapi.models.operations.MarkUnplayedRequestBuilder(this); } @@ -123,8 +175,8 @@ public class Media implements * Mark Media Unplayed * This will mark the provided media key as Unplayed. * @param key The media key to mark as Unplayed - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse markUnplayed( double key) throws Exception { @@ -134,66 +186,108 @@ public class Media implements .key(key) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/:/unscrobble"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.MarkUnplayedRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.MarkUnplayedRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("markUnplayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("markUnplayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("markUnplayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("markUnplayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.MarkUnplayedResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Update Media Play Progress + * This API command can be used to update the play progress of a media item. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequestBuilder updatePlayProgress() { return new lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequestBuilder(this); } @@ -205,8 +299,8 @@ public class Media implements * @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 The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse updatePlayProgress( String key, @@ -220,63 +314,98 @@ public class Media implements .state(state) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/:/progress"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("POST"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("updatePlayProgress", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("updatePlayProgress", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("updatePlayProgress", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("updatePlayProgress", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.UpdatePlayProgressResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Playlists.java b/src/main/java/lukehagar/plexapi/plexapi/Playlists.java index f3a75262..ef2ca8dc 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Playlists.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Playlists.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -45,6 +50,15 @@ public class Playlists implements this.sdkConfiguration = 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. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.CreatePlaylistRequestBuilder createPlaylist() { return new lukehagar.plexapi.plexapi.models.operations.CreatePlaylistRequestBuilder(this); } @@ -56,92 +70,143 @@ public class Playlists implements * - `playQueueID` - To create a playlist from an existing play queue. * * @param request The request object containing all of the parameters for the API call. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponse createPlaylist( lukehagar.plexapi.plexapi.models.operations.CreatePlaylistRequest request) throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/playlists"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("POST"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.CreatePlaylistRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.CreatePlaylistRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("createPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("createPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("createPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("createPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.CreatePlaylistPlaylistsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.CreatePlaylistResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get All Playlists + * Get All Playlists given the specified filters. + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetPlaylistsRequestBuilder getPlaylists() { return new lukehagar.plexapi.plexapi.models.operations.GetPlaylistsRequestBuilder(this); } + /** + * Get All Playlists + * Get All Playlists given the specified filters. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponse getPlaylistsDirect() throws Exception { + 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 The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponse getPlaylists( Optional playlistType, @@ -153,76 +218,120 @@ public class Playlists implements .smart(smart) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/playlists"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetPlaylistsRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetPlaylistsRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getPlaylists", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getPlaylists", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getPlaylists", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getPlaylists", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistsPlaylistsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetPlaylistsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetPlaylistRequestBuilder getPlaylist() { return new lukehagar.plexapi.plexapi.models.operations.GetPlaylistRequestBuilder(this); } @@ -233,8 +342,8 @@ public class Playlists implements * 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 The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetPlaylistResponse getPlaylist( double playlistID) throws Exception { @@ -244,70 +353,116 @@ public class Playlists implements .playlistID(playlistID) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.GetPlaylistRequest.class, - baseUrl, + _baseUrl, "/playlists/{playlistID}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetPlaylistResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetPlaylistResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetPlaylistResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetPlaylistResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistPlaylistsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetPlaylistResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Deletes a Playlist + * This endpoint will delete a playlist + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.DeletePlaylistRequestBuilder deletePlaylist() { return new lukehagar.plexapi.plexapi.models.operations.DeletePlaylistRequestBuilder(this); } @@ -317,8 +472,8 @@ public class Playlists implements * This endpoint will delete a playlist * * @param playlistID the ID of the playlist - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.DeletePlaylistResponse deletePlaylist( double playlistID) throws Exception { @@ -328,64 +483,121 @@ public class Playlists implements .playlistID(playlistID) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.DeletePlaylistRequest.class, - baseUrl, + _baseUrl, "/playlists/{playlistID}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("DELETE"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("deletePlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("deletePlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("deletePlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("deletePlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.DeletePlaylistResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.DeletePlaylistResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.DeletePlaylistResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.DeletePlaylistResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.DeletePlaylistResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.DeletePlaylistResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "204")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.DeletePlaylistResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistRequestBuilder updatePlaylist() { return new lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistRequestBuilder(this); } + /** + * 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 The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistResponse updatePlaylist( + double playlistID) throws Exception { + 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}` @@ -393,8 +605,8 @@ public class Playlists implements * @param playlistID the ID of the playlist * @param title name of the playlist * @param summary summary description of the playlist - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistResponse updatePlaylist( double playlistID, @@ -408,68 +620,113 @@ public class Playlists implements .summary(summary) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistRequest.class, - baseUrl, + _baseUrl, "/playlists/{playlistID}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "PUT"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("PUT"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("updatePlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("updatePlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("updatePlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("updatePlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.UpdatePlaylistResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsRequestBuilder getPlaylistContents() { return new lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsRequestBuilder(this); } @@ -483,8 +740,8 @@ public class Playlists implements * * @param playlistID the ID of the playlist * @param type the metadata type of the item to return - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsResponse getPlaylistContents( double playlistID, @@ -496,78 +753,121 @@ public class Playlists implements .type(type) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsRequest.class, - baseUrl, + _baseUrl, "/playlists/{playlistID}/items", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsPlaylistsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetPlaylistContentsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Delete Playlist Contents + * Clears a playlist, only works with dumb playlists. Returns the playlist. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsRequestBuilder clearPlaylistContents() { return new lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsRequestBuilder(this); } @@ -577,8 +877,8 @@ public class Playlists implements * Clears a playlist, only works with dumb playlists. Returns the playlist. * * @param playlistID the ID of the playlist - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse clearPlaylistContents( double playlistID) throws Exception { @@ -588,64 +888,125 @@ public class Playlists implements .playlistID(playlistID) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsRequest.class, - baseUrl, + _baseUrl, "/playlists/{playlistID}/items", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("DELETE"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("clearPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("clearPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("clearPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("clearPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.ClearPlaylistContentsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsRequestBuilder addPlaylistContents() { return new lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsRequestBuilder(this); } + /** + * 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 The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponse addPlaylistContents( + double playlistID, + String uri) throws Exception { + 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. @@ -654,8 +1015,8 @@ public class Playlists implements * @param playlistID the ID of the playlist * @param uri the content URI for the playlist * @param playQueueID the play queue to add to a playlist - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponse addPlaylistContents( double playlistID, @@ -669,78 +1030,121 @@ public class Playlists implements .playQueueID(playQueueID) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsRequest.class, - baseUrl, + _baseUrl, "/playlists/{playlistID}/items", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "PUT"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("PUT"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("addPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("addPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("addPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("addPlaylistContents", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsPlaylistsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.AddPlaylistContentsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.UploadPlaylistRequestBuilder uploadPlaylist() { return new lukehagar.plexapi.plexapi.models.operations.UploadPlaylistRequestBuilder(this); } @@ -761,8 +1165,8 @@ public class Playlists implements The `force` argument is used to disable overwriting. If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.UploadPlaylistResponse uploadPlaylist( String path, @@ -774,63 +1178,98 @@ public class Playlists implements .force(force) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/playlists/upload"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("POST"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.UploadPlaylistRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.UploadPlaylistRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("uploadPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("uploadPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("uploadPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("uploadPlaylist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.UploadPlaylistResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.UploadPlaylistResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.UploadPlaylistResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.UploadPlaylistResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.UploadPlaylistResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.UploadPlaylistResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.UploadPlaylistResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Plex.java b/src/main/java/lukehagar/plexapi/plexapi/Plex.java index 16dca54e..8eb68cbe 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Plex.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Plex.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -17,7 +18,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,6 +32,7 @@ import org.openapitools.jackson.nullable.JsonNullable; * */ public class Plex implements + MethodCallGetHomeData, MethodCallGetPin, MethodCallGetToken { @@ -50,10 +56,146 @@ public class Plex implements this.sdkConfiguration = 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 The call builder + */ + public lukehagar.plexapi.plexapi.models.operations.GetHomeDataRequestBuilder getHomeData() { + return new lukehagar.plexapi.plexapi.models.operations.GetHomeDataRequestBuilder(this); + } + + /** + * 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 response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.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", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getHomeData", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getHomeData", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getHomeData", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getHomeData", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponse.Builder _resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetHomeDataResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Get a Pin + * Retrieve a Pin from Plex.tv for authentication flows + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetPinRequestBuilder getPin() { return new lukehagar.plexapi.plexapi.models.operations.GetPinRequestBuilder(this); } + /** + * Get a Pin + * Retrieve a Pin from Plex.tv for authentication flows + * @param xPlexProduct Product name of the application shown in the list of devices + + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetPinResponse getPin( + String xPlexProduct) throws Exception { + return getPin(Optional.empty(), Optional.empty(), xPlexProduct, Optional.empty()); + } /** * Get a Pin * Retrieve a Pin from Plex.tv for authentication flows @@ -65,103 +207,152 @@ public class Plex implements This is used to track the client application and its usage (UUID, serial number, or other number unique per device) + * @param xPlexProduct Product name of the application shown in the list of devices + * @param serverURL Overrides the server URL. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetPinResponse getPin( Optional strong, - String xPlexClientIdentifier, + Optional xPlexClientIdentifier, + String xPlexProduct, java.util.Optional serverURL) throws Exception { lukehagar.plexapi.plexapi.models.operations.GetPinRequest request = lukehagar.plexapi.plexapi.models.operations.GetPinRequest .builder() .strong(strong) .xPlexClientIdentifier(xPlexClientIdentifier) + .xPlexProduct(xPlexProduct) .build(); - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(GET_PIN_SERVERS[0], new java.util.HashMap()); + String _baseUrl = Utils.templateUrl(GET_PIN_SERVERS[0], new java.util.HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { - baseUrl = serverURL.get(); + _baseUrl = serverURL.get(); } - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/pins"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("POST"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetPinRequest.class, + request, + this.sdkConfiguration.globals)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetPinRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getPin", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getPin", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getPin", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getPin", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - java.util.Map> headers = lukehagar.plexapi.plexapi.utils.Utils.getHeaders(request); - if (headers != null) { - for (java.util.Map.Entry> header : headers.entrySet()) { - for (String value : header.getValue()) { - req.addHeader(header.getKey(), value); - } - } - } - - HTTPClient client = this.sdkConfiguration.defaultClient; - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetPinResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetPinResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetPinResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetPinResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetPinResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetPinResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "201")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetPinResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetPinPlexResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetPinResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Access Token + * Retrieve an Access Token from Plex.tv after the Pin has already been authenticated + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetTokenRequestBuilder getToken() { return new lukehagar.plexapi.plexapi.models.operations.GetTokenRequestBuilder(this); } + /** + * Get Access Token + * Retrieve an Access Token from Plex.tv after the Pin has already been authenticated + * @param pinID The PinID to retrieve an access token for + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetTokenResponse getToken( + String pinID) throws Exception { + return getToken(pinID, Optional.empty(), Optional.empty()); + } /** * Get Access Token * Retrieve an Access Token from Plex.tv after the Pin has already been authenticated @@ -171,12 +362,12 @@ public class Plex implements (UUID, serial number, or other number unique per device) * @param serverURL Overrides the server URL. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetTokenResponse getToken( String pinID, - String xPlexClientIdentifier, + Optional xPlexClientIdentifier, java.util.Optional serverURL) throws Exception { lukehagar.plexapi.plexapi.models.operations.GetTokenRequest request = lukehagar.plexapi.plexapi.models.operations.GetTokenRequest @@ -185,66 +376,106 @@ public class Plex implements .xPlexClientIdentifier(xPlexClientIdentifier) .build(); - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(GET_TOKEN_SERVERS[0], new java.util.HashMap()); + String _baseUrl = Utils.templateUrl(GET_TOKEN_SERVERS[0], new java.util.HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { - baseUrl = serverURL.get(); + _baseUrl = serverURL.get(); } - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.GetTokenRequest.class, - baseUrl, + _baseUrl, "/pins/{pinID}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); - - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - java.util.Map> headers = lukehagar.plexapi.plexapi.utils.Utils.getHeaders(request); - if (headers != null) { - for (java.util.Map.Entry> header : headers.entrySet()) { - for (String value : header.getValue()) { - req.addHeader(header.getKey(), value); - } + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = this.sdkConfiguration.defaultClient; - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetTokenResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetTokenResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetTokenResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetTokenResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - } else if (httpRes.statusCode() == 400) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetTokenResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetTokenResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetTokenResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetTokenResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/PlexAPI.java b/src/main/java/lukehagar/plexapi/plexapi/PlexAPI.java index 46ffbb69..4bca489a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/PlexAPI.java +++ b/src/main/java/lukehagar/plexapi/plexapi/PlexAPI.java @@ -9,11 +9,16 @@ import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Optional; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.RetryConfig; import lukehagar.plexapi.plexapi.utils.SpeakeasyHTTPClient; import lukehagar.plexapi.plexapi.utils.Utils; @@ -24,6 +29,8 @@ import org.openapitools.jackson.nullable.JsonNullable; * An Open API Spec for interacting with Plex.tv and Plex Servers */ public class PlexAPI { + + /** * SERVERS contains the list of server urls available to the SDK. */ @@ -70,6 +77,12 @@ public class PlexAPI { */ private final Butler butler; + /** + * API Calls that perform operations directly against https://Plex.tv + * + */ + private final Plex plex; + /** * Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. * @@ -94,12 +107,6 @@ public class PlexAPI { */ private final Log log; - /** - * API Calls that perform operations directly against https://Plex.tv - * - */ - private final Plex plex; - /** * 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. @@ -134,6 +141,12 @@ public class PlexAPI { */ private final Updater updater; + /** + * API Calls that perform operations with Plex Media Server Watchlists + * + */ + private final Watchlist watchlist; + /** * Operations against the Plex Media Server System. * @@ -180,6 +193,14 @@ public class PlexAPI { return butler; } + /** + * API Calls that perform operations directly against https://Plex.tv + * + */ + public Plex plex() { + return plex; + } + /** * Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. * @@ -212,14 +233,6 @@ public class PlexAPI { return log; } - /** - * API Calls that perform operations directly against https://Plex.tv - * - */ - public Plex plex() { - return plex; - } - /** * 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. @@ -264,6 +277,14 @@ public class PlexAPI { return updater; } + /** + * API Calls that perform operations with Plex Media Server Watchlists + * + */ + public Watchlist watchlist() { + return watchlist; + } + private final SDKConfiguration sdkConfiguration; /** @@ -354,9 +375,6 @@ public class PlexAPI { this.sdkConfiguration.retryConfig = Optional.of(retryConfig); return this; } - /** - * ServerProtocol - The protocol to use when connecting to your plex server. - */ public enum ServerProtocol { HTTP("http"), HTTPS("https"); @@ -424,6 +442,27 @@ public class PlexAPI { return this; } + /** + * Allows setting the xPlexClientIdentifier parameter for all supported operations. + * + * @param xPlexClientIdentifier The value to set. + * @return The builder instance. + */ + public Builder xPlexClientIdentifier(String xPlexClientIdentifier) { + if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) { + this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>()); + } + + this.sdkConfiguration.globals.get("parameters").get("header").put("xPlexClientIdentifier", xPlexClientIdentifier); + + return this; + } + + // Visible for testing, will be accessed via reflection + void _hooks(lukehagar.plexapi.plexapi.utils.Hooks hooks) { + sdkConfiguration.setHooks(hooks); + } + /** * Builds a new instance of the SDK. * @return The SDK instance. @@ -432,9 +471,9 @@ public class PlexAPI { if (sdkConfiguration.defaultClient == null) { sdkConfiguration.defaultClient = new SpeakeasyHTTPClient(); } - if (sdkConfiguration.securitySource == null) { - sdkConfiguration.securitySource = SecuritySource.of(null); - } + if (sdkConfiguration.securitySource == null) { + sdkConfiguration.securitySource = SecuritySource.of(null); + } if (sdkConfiguration.serverUrl == null || sdkConfiguration.serverUrl.isBlank()) { sdkConfiguration.serverUrl = SERVERS[0]; sdkConfiguration.serverIdx = 0; @@ -445,7 +484,7 @@ public class PlexAPI { return new PlexAPI(sdkConfiguration); } } - + /** * Get a new instance of the SDK builder to configure a new instance of the SDK. * @return The SDK builder instance. @@ -461,74 +500,16 @@ public class PlexAPI { this.video = new Video(sdkConfiguration); this.activities = new Activities(sdkConfiguration); this.butler = new Butler(sdkConfiguration); + this.plex = new Plex(sdkConfiguration); this.hubs = new Hubs(sdkConfiguration); this.search = new Search(sdkConfiguration); this.library = new Library(sdkConfiguration); this.log = new Log(sdkConfiguration); - this.plex = new Plex(sdkConfiguration); this.playlists = new Playlists(sdkConfiguration); this.authentication = new Authentication(sdkConfiguration); this.statistics = new Statistics(sdkConfiguration); this.sessions = new Sessions(sdkConfiguration); this.updater = new Updater(sdkConfiguration); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} + this.watchlist = new Watchlist(sdkConfiguration); + this.sdkConfiguration.initialize(); + }} diff --git a/src/main/java/lukehagar/plexapi/plexapi/SDKConfiguration.java b/src/main/java/lukehagar/plexapi/plexapi/SDKConfiguration.java index 73ac01d4..f8747371 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/SDKConfiguration.java +++ b/src/main/java/lukehagar/plexapi/plexapi/SDKConfiguration.java @@ -4,6 +4,7 @@ package lukehagar.plexapi.plexapi; +import lukehagar.plexapi.plexapi.utils.Hook.SdkInitData; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.RetryConfig; import lukehagar.plexapi.plexapi.models.shared.Security; @@ -15,25 +16,58 @@ import java.util.Optional; class SDKConfiguration { public SecuritySource securitySource; + + public Optional securitySource() { + return Optional.ofNullable(securitySource); + } public HTTPClient defaultClient; - public String serverUrl; + public String serverUrl; public int serverIdx = 0; - List> serverDefaults = new ArrayList<>(){{ - add(new HashMap<>(){{ - put("protocol", "http"); - put("ip", "10.10.10.47"); - put("port", "32400"); - }}); - }}; - public String language = "java"; - public String openapiDocVersion = "0.0.3"; - public String sdkVersion = "0.0.1"; - public String genVersion = "2.281.2"; - public String userAgent = "speakeasy-sdk/java 0.0.1 2.281.2 0.0.3 lukehagar.plexapi.plexapi"; - - - public Map getServerVariableDefaults() { - return serverDefaults.get(this.serverIdx); - } + List> serverDefaults = new ArrayList<>(){{ + add(new HashMap<>(){{ + put("protocol", "http"); + put("ip", "10.10.10.47"); + put("port", "32400"); + }}); + }}; + public String language = "java"; + public String openapiDocVersion = "0.0.3"; + public String sdkVersion = "0.1.1"; + public String genVersion = "2.354.2"; + public String userAgent = "speakeasy-sdk/java 0.1.1 2.354.2 0.0.3 lukehagar.plexapi.plexapi"; + + private lukehagar.plexapi.plexapi.utils.Hooks _hooks = createHooks(); + + private static lukehagar.plexapi.plexapi.utils.Hooks createHooks() { + lukehagar.plexapi.plexapi.utils.Hooks hooks = new lukehagar.plexapi.plexapi.utils.Hooks(); + return hooks; + } + + public lukehagar.plexapi.plexapi.utils.Hooks hooks() { + return _hooks; + } + + public void setHooks(lukehagar.plexapi.plexapi.utils.Hooks hooks) { + this._hooks = hooks; + } + + /** + * Initializes state (for example hooks). + **/ + public void initialize() { + lukehagar.plexapi.plexapi.hooks.SDKHooks.initialize(_hooks); + // apply the sdk init hook immediately + SdkInitData data = _hooks.sdkInit(new SdkInitData(serverUrl, defaultClient)); + this.serverUrl = data.baseUrl(); + this.defaultClient = data.client(); + } + + public Map>> globals = new HashMap<>(){{ + put("parameters", new HashMap<>()); + }}; + + public Map getServerVariableDefaults() { + return serverDefaults.get(this.serverIdx); + } public Optional retryConfig = Optional.empty(); } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Search.java b/src/main/java/lukehagar/plexapi/plexapi/Search.java index 0f8a8451..06a40bba 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Search.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Search.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -36,10 +41,51 @@ public class Search implements this.sdkConfiguration = 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. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.PerformSearchRequestBuilder performSearch() { return new lukehagar.plexapi.plexapi.models.operations.PerformSearchRequestBuilder(this); } + /** + * 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 The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse performSearch( + String query) throws Exception { + 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). @@ -58,8 +104,8 @@ public class Search implements * @param query The query term * @param sectionId This gives context to the search, and can result in re-ordering of search result hubs * @param limit The number of items to return per hub - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse performSearch( String query, @@ -73,70 +119,130 @@ public class Search implements .limit(limit) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/hubs/search"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.PerformSearchRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.PerformSearchRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("performSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("performSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("performSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("performSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.PerformSearchResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.PerformSearchResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequestBuilder performVoiceSearch() { return new lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequestBuilder(this); } + /** + * 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 The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse performVoiceSearch( + String query) throws Exception { + 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. @@ -147,8 +253,8 @@ public class Search implements * @param query The query term * @param sectionId This gives context to the search, and can result in re-ordering of search result hubs * @param limit The number of items to return per hub - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse performVoiceSearch( String query, @@ -162,66 +268,107 @@ public class Search implements .limit(limit) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/hubs/search/voice"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("performVoiceSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("performVoiceSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("performVoiceSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("performVoiceSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.PerformVoiceSearchResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Search Results + * This will search the database for the string provided. + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetSearchResultsRequestBuilder getSearchResults() { return new lukehagar.plexapi.plexapi.models.operations.GetSearchResultsRequestBuilder(this); } @@ -230,8 +377,8 @@ public class Search implements * Get Search Results * This will search the database for the string provided. * @param query The search query string to use - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse getSearchResults( String query) throws Exception { @@ -241,73 +388,109 @@ public class Search implements .query(query) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/search"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetSearchResultsRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetSearchResultsRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getSearchResults", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getSearchResults", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getSearchResults", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getSearchResults", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetSearchResultsSearchResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetSearchResultsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Server.java b/src/main/java/lukehagar/plexapi/plexapi/Server.java index 04e7b0da..7ba6bd16 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Server.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Server.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -41,79 +46,130 @@ public class Server implements this.sdkConfiguration = sdkConfiguration; } + + /** + * Get Server Capabilities + * Get Server Capabilities + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesRequestBuilder getServerCapabilities() { return new lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesRequestBuilder(this); } /** - * Server Capabilities - * Server Capabilities - * @return The response from the API call. - * @throws Exception if the API call fails. + * Get Server Capabilities + * Get Server Capabilities + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse getServerCapabilitiesDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getServerCapabilities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getServerCapabilities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getServerCapabilities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getServerCapabilities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesServerResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Server Preferences + * Get Server Preferences + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesRequestBuilder getServerPreferences() { return new lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesRequestBuilder(this); } @@ -121,72 +177,117 @@ public class Server implements /** * Get Server Preferences * Get Server Preferences - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse getServerPreferencesDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/:/prefs"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getServerPreferences", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getServerPreferences", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getServerPreferences", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getServerPreferences", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesServerResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetServerPreferencesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Available Clients + * Get Available Clients + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsRequestBuilder getAvailableClients() { return new lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsRequestBuilder(this); } @@ -194,72 +295,117 @@ public class Server implements /** * Get Available Clients * Get Available Clients - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse getAvailableClientsDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/clients"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getAvailableClients", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getAvailableClients", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getAvailableClients", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getAvailableClients", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsServerResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetAvailableClientsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Devices + * Get Devices + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetDevicesRequestBuilder getDevices() { return new lukehagar.plexapi.plexapi.models.operations.GetDevicesRequestBuilder(this); } @@ -267,72 +413,117 @@ public class Server implements /** * Get Devices * Get Devices - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse getDevicesDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/devices"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getDevices", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getDevices", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getDevices", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getDevices", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetDevicesResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetDevicesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetDevicesServerResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetDevicesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Server Identity + * Get Server Identity + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetServerIdentityRequestBuilder getServerIdentity() { return new lukehagar.plexapi.plexapi.models.operations.GetServerIdentityRequestBuilder(this); } @@ -340,72 +531,117 @@ public class Server implements /** * Get Server Identity * Get Server Identity - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse getServerIdentityDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/identity"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getServerIdentity", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getServerIdentity", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getServerIdentity", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getServerIdentity", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetServerIdentityServerResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetServerIdentityResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get MyPlex Account + * Returns MyPlex Account Information + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountRequestBuilder getMyPlexAccount() { return new lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountRequestBuilder(this); } @@ -413,72 +649,118 @@ public class Server implements /** * Get MyPlex Account * Returns MyPlex Account Information - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse getMyPlexAccountDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/myplex/account"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getMyPlexAccount", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getMyPlexAccount", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getMyPlexAccount", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getMyPlexAccount", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountServerResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetMyPlexAccountResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get a Resized Photo + * Plex's Photo transcoder is used throughout the service to serve images at specified sizes. + * + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoRequestBuilder getResizedPhoto() { return new lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoRequestBuilder(this); } @@ -488,71 +770,112 @@ 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. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponse getResizedPhoto( lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoRequest request) throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/photo/:/transcode"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getResizedPhoto", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getResizedPhoto", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getResizedPhoto", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getResizedPhoto", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetResizedPhotoResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Server List + * Get Server List + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetServerListRequestBuilder getServerList() { return new lukehagar.plexapi.plexapi.models.operations.GetServerListRequestBuilder(this); } @@ -560,69 +883,108 @@ public class Server implements /** * Get Server List * Get Server List - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetServerListResponse getServerListDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/servers"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getServerList", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getServerList", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getServerList", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getServerList", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetServerListResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetServerListResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetServerListResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetServerListResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetServerListResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetServerListResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetServerListResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetServerListServerResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetServerListResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Sessions.java b/src/main/java/lukehagar/plexapi/plexapi/Sessions.java index e278615b..de5c4667 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Sessions.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Sessions.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,8 +17,13 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; +import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -36,6 +42,12 @@ public class Sessions implements this.sdkConfiguration = sdkConfiguration; } + + /** + * Get Active Sessions + * This will retrieve the "Now Playing" Information of the PMS. + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetSessionsRequestBuilder getSessions() { return new lukehagar.plexapi.plexapi.models.operations.GetSessionsRequestBuilder(this); } @@ -43,72 +55,117 @@ public class Sessions implements /** * Get Active Sessions * This will retrieve the "Now Playing" Information of the PMS. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse getSessionsDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/status/sessions"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetSessionsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetSessionsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetSessionsSessionsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetSessionsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Session History + * This will Retrieve a listing of all history views. + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryRequestBuilder getSessionHistory() { return new lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryRequestBuilder(this); } @@ -116,72 +173,153 @@ public class Sessions implements /** * Get Session History * This will Retrieve a listing of all history views. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse getSessionHistoryDirect() throws Exception { + 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) - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + * @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 The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse getSessionHistory( + Optional sort, + Optional accountId, + Optional filter, + Optional librarySectionID) throws Exception { + lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryRequest request = + lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryRequest + .builder() + .sort(sort) + .accountId(accountId) + .filter(filter) + .librarySectionID(librarySectionID) + .build(); + + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/status/sessions/history/all"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getSessionHistory", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getSessionHistory", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getSessionHistory", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getSessionHistory", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetSessionHistorySessionsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetSessionHistoryResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Get Transcode Sessions + * Get Transcode Sessions + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsRequestBuilder getTranscodeSessions() { return new lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsRequestBuilder(this); } @@ -189,72 +327,117 @@ public class Sessions implements /** * Get Transcode Sessions * Get Transcode Sessions - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/transcode/sessions"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getTranscodeSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getTranscodeSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getTranscodeSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getTranscodeSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsSessionsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetTranscodeSessionsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Stop a Transcode Session + * Stop a Transcode Session + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionRequestBuilder stopTranscodeSession() { return new lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionRequestBuilder(this); } @@ -263,8 +446,8 @@ public class Sessions implements * Stop a Transcode Session * Stop a Transcode Session * @param sessionKey the Key of the transcode session to stop - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse stopTranscodeSession( String sessionKey) throws Exception { @@ -274,57 +457,95 @@ public class Sessions implements .sessionKey(sessionKey) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( + String _url = Utils.generateURL( lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionRequest.class, - baseUrl, + _baseUrl, "/transcode/sessions/{sessionKey}", - request, null); + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("DELETE"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("stopTranscodeSession", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("stopTranscodeSession", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("stopTranscodeSession", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("stopTranscodeSession", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 204 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "204")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.StopTranscodeSessionResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Statistics.java b/src/main/java/lukehagar/plexapi/plexapi/Statistics.java index 0d74012b..3d05cc03 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Statistics.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Statistics.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,7 +31,9 @@ import org.openapitools.jackson.nullable.JsonNullable; * */ public class Statistics implements - MethodCallGetStatistics { + MethodCallGetStatistics, + MethodCallGetResourcesStatistics, + MethodCallGetBandwidthStatistics { private final SDKConfiguration sdkConfiguration; @@ -34,18 +41,33 @@ public class Statistics implements this.sdkConfiguration = sdkConfiguration; } + + /** + * Get Media Statistics + * This will return the media statistics for the server + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetStatisticsRequestBuilder getStatistics() { return new lukehagar.plexapi.plexapi.models.operations.GetStatisticsRequestBuilder(this); } + /** + * Get Media Statistics + * This will return the media statistics for the server + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse getStatisticsDirect() throws Exception { + 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 The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse getStatistics( Optional timespan) throws Exception { @@ -55,73 +77,393 @@ public class Statistics implements .timespan(timespan) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/statistics/media"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetStatisticsRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetStatisticsRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetStatisticsStatisticsResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetStatisticsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } - return res; + + + /** + * Get Resources Statistics + * This will return the resources for the server + * @return The call builder + */ + public lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsRequestBuilder getResourcesStatistics() { + return new lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsRequestBuilder(this); + } + + /** + * Get Resources Statistics + * This will return the resources for the server + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse getResourcesStatisticsDirect() throws Exception { + 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 The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse getResourcesStatistics( + Optional timespan) throws Exception { + lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsRequest request = + lukehagar.plexapi.plexapi.models.operations.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", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsRequest.class, + request, + this.sdkConfiguration.globals)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getResourcesStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getResourcesStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getResourcesStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getResourcesStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse.Builder _resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetResourcesStatisticsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Get Bandwidth Statistics + * This will return the bandwidth statistics for the server + * @return The call builder + */ + public lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsRequestBuilder getBandwidthStatistics() { + return new lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsRequestBuilder(this); + } + + /** + * Get Bandwidth Statistics + * This will return the bandwidth statistics for the server + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse getBandwidthStatisticsDirect() throws Exception { + 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 The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse getBandwidthStatistics( + Optional timespan) throws Exception { + lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsRequest request = + lukehagar.plexapi.plexapi.models.operations.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", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsRequest.class, + request, + this.sdkConfiguration.globals)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getBandwidthStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getBandwidthStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getBandwidthStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getBandwidthStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse.Builder _resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetBandwidthStatisticsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Updater.java b/src/main/java/lukehagar/plexapi/plexapi/Updater.java index 45b5eaaf..2272c31d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Updater.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Updater.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -37,6 +42,12 @@ public class Updater implements this.sdkConfiguration = sdkConfiguration; } + + /** + * Querying status of updates + * Querying status of updates + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusRequestBuilder getUpdateStatus() { return new lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusRequestBuilder(this); } @@ -44,82 +55,136 @@ public class Updater implements /** * Querying status of updates * Querying status of updates - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse getUpdateStatusDirect() throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/updater/status"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getUpdateStatus", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getUpdateStatus", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getUpdateStatus", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getUpdateStatus", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), + lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), new TypeReference() {}); - res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out)); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); - } - } else if (httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusUpdaterResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out)); - } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetUpdateStatusResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Checking for updates + * Checking for updates + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequestBuilder checkForUpdates() { return new lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequestBuilder(this); } + /** + * Checking for updates + * Checking for updates + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse checkForUpdatesDirect() throws Exception { + return checkForUpdates(Optional.empty()); + } /** * Checking for updates * Checking for updates * @param download Indicate that you want to start download any updates found. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse checkForUpdates( Optional download) throws Exception { @@ -129,78 +194,130 @@ public class Updater implements .download(download) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/updater/check"); + + HTTPRequest _req = new HTTPRequest(_url, "PUT"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("PUT"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("checkForUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("checkForUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("checkForUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("checkForUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.CheckForUpdatesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * 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 call builder + */ public lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequestBuilder applyUpdates() { return new lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequestBuilder(this); } + /** + * 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 response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse applyUpdatesDirect() throws Exception { + 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 entry for this version will have the `state` set to `skipped`. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse applyUpdates( Optional tonight, @@ -212,63 +329,98 @@ public class Updater implements .skip(skip) .build(); - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/updater/apply"); + + HTTPRequest _req = new HTTPRequest(_url, "PUT"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("PUT"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("applyUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "500", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("applyUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("applyUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("applyUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400 || httpRes.statusCode() == 500) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "500", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.ApplyUpdatesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Video.java b/src/main/java/lukehagar/plexapi/plexapi/Video.java index 2a76460a..d63b4f4a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/Video.java +++ b/src/main/java/lukehagar/plexapi/plexapi/Video.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError; import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; import lukehagar.plexapi.plexapi.utils.HTTPClient; import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; import lukehagar.plexapi.plexapi.utils.Utils; import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; @@ -35,6 +40,12 @@ public class Video implements this.sdkConfiguration = sdkConfiguration; } + + /** + * Get the timeline for a media item + * Get the timeline for a media item + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.GetTimelineRequestBuilder getTimeline() { return new lukehagar.plexapi.plexapi.models.operations.GetTimelineRequestBuilder(this); } @@ -43,71 +54,112 @@ public class Video implements * Get the timeline for a media item * Get the timeline for a media item * @param request The request object containing all of the parameters for the API call. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse getTimeline( lukehagar.plexapi.plexapi.models.operations.GetTimelineRequest request) throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/:/timeline"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetTimelineRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.GetTimelineRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getTimeline", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getTimeline", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getTimeline", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getTimeline", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.GetTimelineResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetTimelineResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } + + /** + * Start Universal Transcode + * Begin a Universal Transcode Session + * @return The call builder + */ public lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequestBuilder startUniversalTranscode() { return new lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequestBuilder(this); } @@ -116,68 +168,103 @@ public class Video implements * Start Universal Transcode * Begin a Universal Transcode Session * @param request The request object containing all of the parameters for the API call. - * @return The response from the API call. - * @throws Exception if the API call fails. + * @return The response from the API call + * @throws Exception if the API call fails */ public lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse startUniversalTranscode( lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest request) throws Exception { - - String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl( + String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); - - String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL( - baseUrl, + String _url = Utils.generateURL( + _baseUrl, "/video/:/transcode/universal/start.mpd"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); - HTTPRequest req = new HTTPRequest(); - req.setMethod("GET"); - req.setURL(url); + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest.class, + request, + this.sdkConfiguration.globals)); - req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", this.sdkConfiguration.userAgent); + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); - java.util.List queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams( - lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest.class, request, null); - if (queryParams != null) { - for (NameValuePair queryParam : queryParams) { - req.addQueryParam(queryParam); + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("startUniversalTranscode", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("startUniversalTranscode", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("startUniversalTranscode", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("startUniversalTranscode", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); } - - HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient( - this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); - - HttpResponse httpRes = client.send(req); - - String contentType = httpRes + String _contentType = _httpRes .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse.Builder resBuilder = + lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse.Builder _resBuilder = lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse .builder() - .contentType(contentType) - .statusCode(httpRes.statusCode()) - .rawResponse(httpRes); + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); - lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse res = resBuilder.build(); - - res.withRawResponse(httpRes); - - if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) { - } else if (httpRes.statusCode() == 401) { - if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) { - ObjectMapper mapper = JSON.getMapper(); - lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponseBody out = mapper.readValue( - Utils.toUtf8AndClose(httpRes.body()), - new TypeReference() {}); - res.withObject(java.util.Optional.ofNullable(out)); + lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.StartUniversalTranscodeResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; } else { - throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); } } - - return res; + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/Watchlist.java b/src/main/java/lukehagar/plexapi/plexapi/Watchlist.java new file mode 100644 index 00000000..b4650a4c --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/Watchlist.java @@ -0,0 +1,193 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import lukehagar.plexapi.plexapi.models.errors.SDKError; +import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*; +import lukehagar.plexapi.plexapi.utils.HTTPClient; +import lukehagar.plexapi.plexapi.utils.HTTPRequest; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl; +import lukehagar.plexapi.plexapi.utils.JSON; +import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException; +import lukehagar.plexapi.plexapi.utils.Utils; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * API Calls that perform operations with Plex Media Server Watchlists + * + */ +public class Watchlist implements + MethodCallGetWatchlist { + + /** + * GET_WATCHLIST_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] GET_WATCHLIST_SERVERS = { + /** + * The plex metadata provider server + */ + "https://metadata.provider.plex.tv", + }; + + private final SDKConfiguration sdkConfiguration; + + Watchlist(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Get User Watchlist + * Get User Watchlist + * @return The call builder + */ + public lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequestBuilder getWatchlist() { + return new lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequestBuilder(this); + } + + /** + * Get User Watchlist + * Get User Watchlist + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse getWatchlist( + lukehagar.plexapi.plexapi.models.operations.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 serverURL Overrides the server URL. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse getWatchlist( + lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequest request, + java.util.Optional serverURL) throws Exception { + String _baseUrl = Utils.templateUrl(GET_WATCHLIST_SERVERS[0], new java.util.HashMap()); + if (serverURL.isPresent() && !serverURL.get().isBlank()) { + _baseUrl = serverURL.get(); + } + String _url = Utils.generateURL( + lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequest.class, + _baseUrl, + "/library/sections/watchlist/{filter}", + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequest.class, + request, + this.sdkConfiguration.globals)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("getWatchlist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("getWatchlist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("getWatchlist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("getWatchlist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse.Builder _resBuilder = + lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + lukehagar.plexapi.plexapi.models.errors.GetWatchlistResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(java.util.Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/hooks/SDKHooks.java b/src/main/java/lukehagar/plexapi/plexapi/hooks/SDKHooks.java new file mode 100644 index 00000000..df9157e2 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/hooks/SDKHooks.java @@ -0,0 +1,26 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.hooks; + +// +// 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. +// + +public final class SDKHooks { + + private SDKHooks() { + // prevent instantiation + } + + public static final void initialize(lukehagar.plexapi.plexapi.utils.Hooks hooks) { + // register hooks here + + // for more information see + // https://www.speakeasyapi.dev/docs/additional-features/sdk-hooks + } + +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/AddPlaylistContentsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/AddPlaylistContentsErrors.java index 2fb9866f..f347229b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/AddPlaylistContentsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class AddPlaylistContentsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class AddPlaylistContentsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public AddPlaylistContentsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class AddPlaylistContentsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public AddPlaylistContentsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/AddPlaylistContentsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/AddPlaylistContentsResponseBody.java new file mode 100644 index 00000000..5688610d --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/AddPlaylistContentsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * AddPlaylistContentsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class AddPlaylistContentsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public AddPlaylistContentsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public AddPlaylistContentsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public AddPlaylistContentsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public AddPlaylistContentsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AddPlaylistContentsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AddPlaylistContentsResponseBody 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; + } + AddPlaylistContentsResponseBody other = (AddPlaylistContentsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(AddPlaylistContentsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 AddPlaylistContentsResponseBody build() { + return new AddPlaylistContentsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/ApplyUpdatesErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/ApplyUpdatesErrors.java index da46a6ab..9d5b283e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/ApplyUpdatesErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class ApplyUpdatesErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class ApplyUpdatesErrors { @JsonProperty("status") private Optional status; + @JsonCreator public ApplyUpdatesErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class ApplyUpdatesErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public ApplyUpdatesErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/ApplyUpdatesResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/ApplyUpdatesResponseBody.java index 22bbcb1d..c3ef7482 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/ApplyUpdatesResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * ApplyUpdatesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class ApplyUpdatesResponseBody { +public class ApplyUpdatesResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public ApplyUpdatesResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public ApplyUpdatesResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class ApplyUpdatesResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public ApplyUpdatesResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ApplyUpdatesResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ApplyUpdatesResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class ApplyUpdatesResponseBody { return false; } ApplyUpdatesResponseBody other = (ApplyUpdatesResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(ApplyUpdatesResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class ApplyUpdatesResponseBody { 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 ApplyUpdatesResponseBody build() { return new ApplyUpdatesResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/AuthException.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/AuthException.java new file mode 100644 index 00000000..1f9fe0db --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/AuthException.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import java.util.Optional; + +/** + * An exception associated with Authentication or Authorization. + */ +@SuppressWarnings("serial") +public class AuthException extends RuntimeException { + + private final Optional statusCode; + + private AuthException(Optional statusCode, String message) { + super(message); + this.statusCode = statusCode; + } + + public AuthException(int statusCode, String message) { + this(Optional.of(statusCode), message); + } + + public AuthException(String message) { + this(Optional.empty(), message); + } + + public Optional statusCode() { + return statusCode; + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CancelServerActivitiesErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/CancelServerActivitiesErrors.java index 9e7cbfe6..28f27d53 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CancelServerActivitiesErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class CancelServerActivitiesErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class CancelServerActivitiesErrors { @JsonProperty("status") private Optional status; + @JsonCreator public CancelServerActivitiesErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class CancelServerActivitiesErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public CancelServerActivitiesErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CancelServerActivitiesResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/CancelServerActivitiesResponseBody.java index 4eca3f96..72b81d5c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CancelServerActivitiesResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * CancelServerActivitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class CancelServerActivitiesResponseBody { +public class CancelServerActivitiesResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public CancelServerActivitiesResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public CancelServerActivitiesResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class CancelServerActivitiesResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public CancelServerActivitiesResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CancelServerActivitiesResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CancelServerActivitiesResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class CancelServerActivitiesResponseBody { return false; } CancelServerActivitiesResponseBody other = (CancelServerActivitiesResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(CancelServerActivitiesResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class CancelServerActivitiesResponseBody { 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 CancelServerActivitiesResponseBody build() { return new CancelServerActivitiesResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CheckForUpdatesErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/CheckForUpdatesErrors.java index 803edf9a..b9d73dda 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CheckForUpdatesErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class CheckForUpdatesErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class CheckForUpdatesErrors { @JsonProperty("status") private Optional status; + @JsonCreator public CheckForUpdatesErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class CheckForUpdatesErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public CheckForUpdatesErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CheckForUpdatesResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/CheckForUpdatesResponseBody.java index 029a6042..29443f31 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CheckForUpdatesResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * CheckForUpdatesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class CheckForUpdatesResponseBody { +public class CheckForUpdatesResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public CheckForUpdatesResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public CheckForUpdatesResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class CheckForUpdatesResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public CheckForUpdatesResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CheckForUpdatesResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CheckForUpdatesResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class CheckForUpdatesResponseBody { return false; } CheckForUpdatesResponseBody other = (CheckForUpdatesResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(CheckForUpdatesResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class CheckForUpdatesResponseBody { 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 CheckForUpdatesResponseBody build() { return new CheckForUpdatesResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/ClearPlaylistContentsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/ClearPlaylistContentsErrors.java index 7a0fe54e..50be5c9e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/ClearPlaylistContentsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class ClearPlaylistContentsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class ClearPlaylistContentsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public ClearPlaylistContentsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class ClearPlaylistContentsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public ClearPlaylistContentsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/ClearPlaylistContentsResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/ClearPlaylistContentsResponseBody.java index 1c748508..9f721d12 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/ClearPlaylistContentsResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * ClearPlaylistContentsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class ClearPlaylistContentsResponseBody { +public class ClearPlaylistContentsResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public ClearPlaylistContentsResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public ClearPlaylistContentsResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class ClearPlaylistContentsResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public ClearPlaylistContentsResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ClearPlaylistContentsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ClearPlaylistContentsResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class ClearPlaylistContentsResponseBody { return false; } ClearPlaylistContentsResponseBody other = (ClearPlaylistContentsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(ClearPlaylistContentsResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class ClearPlaylistContentsResponseBody { 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 ClearPlaylistContentsResponseBody build() { return new ClearPlaylistContentsResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CreatePlaylistErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/CreatePlaylistErrors.java index 9d55cfaa..209b3a34 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CreatePlaylistErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class CreatePlaylistErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class CreatePlaylistErrors { @JsonProperty("status") private Optional status; + @JsonCreator public CreatePlaylistErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class CreatePlaylistErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public CreatePlaylistErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/CreatePlaylistResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CreatePlaylistResponseBody.java new file mode 100644 index 00000000..3564d552 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/CreatePlaylistResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * CreatePlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class CreatePlaylistResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public CreatePlaylistResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public CreatePlaylistResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public CreatePlaylistResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public CreatePlaylistResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreatePlaylistResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreatePlaylistResponseBody 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; + } + CreatePlaylistResponseBody other = (CreatePlaylistResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreatePlaylistResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 CreatePlaylistResponseBody build() { + return new CreatePlaylistResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/DeleteLibraryErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/DeleteLibraryErrors.java index 936ce415..d339f658 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/DeleteLibraryErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class DeleteLibraryErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class DeleteLibraryErrors { @JsonProperty("status") private Optional status; + @JsonCreator public DeleteLibraryErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class DeleteLibraryErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public DeleteLibraryErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/DeleteLibraryResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/DeleteLibraryResponseBody.java index 5b865786..bc40dcb8 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/DeleteLibraryResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * DeleteLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class DeleteLibraryResponseBody { +public class DeleteLibraryResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public DeleteLibraryResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public DeleteLibraryResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class DeleteLibraryResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public DeleteLibraryResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteLibraryResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteLibraryResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class DeleteLibraryResponseBody { return false; } DeleteLibraryResponseBody other = (DeleteLibraryResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(DeleteLibraryResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class DeleteLibraryResponseBody { 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 DeleteLibraryResponseBody build() { return new DeleteLibraryResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/DeletePlaylistErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/DeletePlaylistErrors.java index 7207f8cb..410b407f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/DeletePlaylistErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class DeletePlaylistErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class DeletePlaylistErrors { @JsonProperty("status") private Optional status; + @JsonCreator public DeletePlaylistErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class DeletePlaylistErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public DeletePlaylistErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/DeletePlaylistResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/DeletePlaylistResponseBody.java index b604bcdf..2b3a7ad4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/DeletePlaylistResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * DeletePlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class DeletePlaylistResponseBody { +public class DeletePlaylistResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public DeletePlaylistResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public DeletePlaylistResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class DeletePlaylistResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public DeletePlaylistResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeletePlaylistResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeletePlaylistResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class DeletePlaylistResponseBody { return false; } DeletePlaylistResponseBody other = (DeletePlaylistResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(DeletePlaylistResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class DeletePlaylistResponseBody { 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 DeletePlaylistResponseBody build() { return new DeletePlaylistResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/EnablePaperTrailErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/EnablePaperTrailErrors.java index eef70ab2..449a7a78 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/EnablePaperTrailErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class EnablePaperTrailErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class EnablePaperTrailErrors { @JsonProperty("status") private Optional status; + @JsonCreator public EnablePaperTrailErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class EnablePaperTrailErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public EnablePaperTrailErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/EnablePaperTrailResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/EnablePaperTrailResponseBody.java index 765806d7..50888c3e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/EnablePaperTrailResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * EnablePaperTrailResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class EnablePaperTrailResponseBody { +public class EnablePaperTrailResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public EnablePaperTrailResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public EnablePaperTrailResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class EnablePaperTrailResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public EnablePaperTrailResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public EnablePaperTrailResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public EnablePaperTrailResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class EnablePaperTrailResponseBody { return false; } EnablePaperTrailResponseBody other = (EnablePaperTrailResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(EnablePaperTrailResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class EnablePaperTrailResponseBody { 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 EnablePaperTrailResponseBody build() { return new EnablePaperTrailResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Errors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/Errors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/Errors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/Errors.java index cbb46bfd..fa3fa152 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Errors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/Errors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Errors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class Errors { @JsonProperty("status") private Optional status; + @JsonCreator public Errors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class Errors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public Errors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetAvailableClientsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetAvailableClientsErrors.java index 8ffe4efa..734d1539 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetAvailableClientsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetAvailableClientsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetAvailableClientsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetAvailableClientsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetAvailableClientsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetAvailableClientsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetAvailableClientsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetAvailableClientsResponseBody.java new file mode 100644 index 00000000..0fbfbb3c --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetAvailableClientsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetAvailableClientsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetAvailableClientsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetAvailableClientsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetAvailableClientsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetAvailableClientsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetAvailableClientsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAvailableClientsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAvailableClientsResponseBody 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; + } + GetAvailableClientsResponseBody other = (GetAvailableClientsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAvailableClientsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetAvailableClientsResponseBody build() { + return new GetAvailableClientsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetBandwidthStatisticsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetBandwidthStatisticsErrors.java new file mode 100644 index 00000000..e6c2db0c --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetBandwidthStatisticsErrors.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public GetBandwidthStatisticsErrors( + @JsonProperty("code") Optional code, + @JsonProperty("message") Optional message, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(status, "status"); + this.code = code; + this.message = message; + this.status = status; + } + + public GetBandwidthStatisticsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetBandwidthStatisticsErrors withCode(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public GetBandwidthStatisticsErrors withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public GetBandwidthStatisticsErrors withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public GetBandwidthStatisticsErrors withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public GetBandwidthStatisticsErrors withStatus(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBandwidthStatisticsErrors other = (GetBandwidthStatisticsErrors) o; + return + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + code, + message, + status); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsErrors.class, + "code", code, + "message", message, + "status", status); + } + + public final static class Builder { + + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder code(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public Builder code(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder status(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public GetBandwidthStatisticsErrors build() { + return new GetBandwidthStatisticsErrors( + code, + message, + status); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetBandwidthStatisticsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetBandwidthStatisticsResponseBody.java new file mode 100644 index 00000000..031f0ca8 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetBandwidthStatisticsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetBandwidthStatisticsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetBandwidthStatisticsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetBandwidthStatisticsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetBandwidthStatisticsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetBandwidthStatisticsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetBandwidthStatisticsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBandwidthStatisticsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBandwidthStatisticsResponseBody 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; + } + GetBandwidthStatisticsResponseBody other = (GetBandwidthStatisticsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetBandwidthStatisticsResponseBody build() { + return new GetBandwidthStatisticsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetButlerTasksErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetButlerTasksErrors.java index eb1557b7..934776b7 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetButlerTasksErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetButlerTasksErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetButlerTasksErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetButlerTasksErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetButlerTasksErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetButlerTasksErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetButlerTasksResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetButlerTasksResponseBody.java new file mode 100644 index 00000000..92b532e6 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetButlerTasksResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetButlerTasksResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetButlerTasksResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetButlerTasksResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetButlerTasksResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetButlerTasksResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetButlerTasksResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetButlerTasksResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetButlerTasksResponseBody 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; + } + GetButlerTasksResponseBody other = (GetButlerTasksResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetButlerTasksResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetButlerTasksResponseBody build() { + return new GetButlerTasksResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetDevicesErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetDevicesErrors.java index 0a064993..8a5c5079 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetDevicesErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetDevicesErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetDevicesErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetDevicesErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetDevicesErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetDevicesErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetDevicesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetDevicesResponseBody.java new file mode 100644 index 00000000..27295acd --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetDevicesResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetDevicesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetDevicesResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetDevicesResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetDevicesResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetDevicesResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetDevicesResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetDevicesResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetDevicesResponseBody 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; + } + GetDevicesResponseBody other = (GetDevicesResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetDevicesResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetDevicesResponseBody build() { + return new GetDevicesResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetFileHashErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetFileHashErrors.java index 5c1c7284..a6961706 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetFileHashErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetFileHashErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetFileHashErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetFileHashErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetFileHashErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetFileHashErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetFileHashResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetFileHashResponseBody.java index aced6f85..b5df26d9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetFileHashResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * GetFileHashResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class GetFileHashResponseBody { +public class GetFileHashResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public GetFileHashResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetFileHashResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class GetFileHashResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public GetFileHashResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetFileHashResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetFileHashResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class GetFileHashResponseBody { return false; } GetFileHashResponseBody other = (GetFileHashResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(GetFileHashResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class GetFileHashResponseBody { 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 GetFileHashResponseBody build() { return new GetFileHashResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetGlobalHubsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetGlobalHubsErrors.java index 0028f920..9c2376ee 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetGlobalHubsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetGlobalHubsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetGlobalHubsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetGlobalHubsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetGlobalHubsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetGlobalHubsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetGlobalHubsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetGlobalHubsResponseBody.java new file mode 100644 index 00000000..0d05b510 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetGlobalHubsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetGlobalHubsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetGlobalHubsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetGlobalHubsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetGlobalHubsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetGlobalHubsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetGlobalHubsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGlobalHubsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGlobalHubsResponseBody 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; + } + GetGlobalHubsResponseBody other = (GetGlobalHubsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetGlobalHubsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetGlobalHubsResponseBody build() { + return new GetGlobalHubsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetHomeDataErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetHomeDataErrors.java new file mode 100644 index 00000000..d76306dd --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetHomeDataErrors.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public GetHomeDataErrors( + @JsonProperty("code") Optional code, + @JsonProperty("message") Optional message, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(status, "status"); + this.code = code; + this.message = message; + this.status = status; + } + + public GetHomeDataErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetHomeDataErrors withCode(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public GetHomeDataErrors withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public GetHomeDataErrors withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public GetHomeDataErrors withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public GetHomeDataErrors withStatus(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetHomeDataErrors other = (GetHomeDataErrors) o; + return + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + code, + message, + status); + } + + @Override + public String toString() { + return Utils.toString(GetHomeDataErrors.class, + "code", code, + "message", message, + "status", status); + } + + public final static class Builder { + + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder code(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public Builder code(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder status(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public GetHomeDataErrors build() { + return new GetHomeDataErrors( + code, + message, + status); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetHomeDataResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetHomeDataResponseBody.java new file mode 100644 index 00000000..d0afa29a --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetHomeDataResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetHomeDataResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetHomeDataResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetHomeDataResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetHomeDataResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetHomeDataResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetHomeDataResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetHomeDataResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetHomeDataResponseBody 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; + } + GetHomeDataResponseBody other = (GetHomeDataResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetHomeDataResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetHomeDataResponseBody build() { + return new GetHomeDataResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibrariesErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibrariesErrors.java index 31bc281b..c976f770 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibrariesErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibrariesErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetLibrariesErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetLibrariesErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetLibrariesErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetLibrariesErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibrariesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibrariesResponseBody.java new file mode 100644 index 00000000..331133b6 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibrariesResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetLibrariesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetLibrariesResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetLibrariesResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibrariesResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibrariesResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetLibrariesResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibrariesResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibrariesResponseBody 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; + } + GetLibrariesResponseBody other = (GetLibrariesResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibrariesResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetLibrariesResponseBody build() { + return new GetLibrariesResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryErrors.java index 21abdc07..294053d1 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetLibraryErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetLibraryErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetLibraryErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetLibraryErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryHubsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryHubsErrors.java index 539d4843..1b3d1d86 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryHubsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetLibraryHubsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetLibraryHubsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetLibraryHubsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetLibraryHubsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryHubsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryHubsResponseBody.java new file mode 100644 index 00000000..5d2600c9 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryHubsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetLibraryHubsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetLibraryHubsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetLibraryHubsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibraryHubsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryHubsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetLibraryHubsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryHubsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryHubsResponseBody 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; + } + GetLibraryHubsResponseBody other = (GetLibraryHubsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryHubsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetLibraryHubsResponseBody build() { + return new GetLibraryHubsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryItemsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryItemsErrors.java new file mode 100644 index 00000000..9a13dcb2 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryItemsErrors.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public GetLibraryItemsErrors( + @JsonProperty("code") Optional code, + @JsonProperty("message") Optional message, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(status, "status"); + this.code = code; + this.message = message; + this.status = status; + } + + public GetLibraryItemsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryItemsErrors withCode(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public GetLibraryItemsErrors withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public GetLibraryItemsErrors withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public GetLibraryItemsErrors withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public GetLibraryItemsErrors withStatus(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsErrors other = (GetLibraryItemsErrors) o; + return + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + code, + message, + status); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsErrors.class, + "code", code, + "message", message, + "status", status); + } + + public final static class Builder { + + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder code(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public Builder code(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder status(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public GetLibraryItemsErrors build() { + return new GetLibraryItemsErrors( + code, + message, + status); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryItemsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryItemsResponseBody.java new file mode 100644 index 00000000..5a54de27 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryItemsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetLibraryItemsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetLibraryItemsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetLibraryItemsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibraryItemsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryItemsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetLibraryItemsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryItemsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryItemsResponseBody 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; + } + GetLibraryItemsResponseBody other = (GetLibraryItemsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetLibraryItemsResponseBody build() { + return new GetLibraryItemsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryResponseBody.java new file mode 100644 index 00000000..98bb21f7 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetLibraryResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetLibraryResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetLibraryResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibraryResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetLibraryResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryResponseBody 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; + } + GetLibraryResponseBody other = (GetLibraryResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetLibraryResponseBody build() { + return new GetLibraryResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataChildrenErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataChildrenErrors.java index cf78682a..34af10d6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataChildrenErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataChildrenErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetMetadataChildrenErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetMetadataChildrenErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetMetadataChildrenErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetMetadataChildrenErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataChildrenResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataChildrenResponseBody.java new file mode 100644 index 00000000..3d116d1e --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataChildrenResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetMetadataChildrenResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetMetadataChildrenResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetMetadataChildrenResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMetadataChildrenResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetMetadataChildrenResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetMetadataChildrenResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMetadataChildrenResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMetadataChildrenResponseBody 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; + } + GetMetadataChildrenResponseBody other = (GetMetadataChildrenResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMetadataChildrenResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetMetadataChildrenResponseBody build() { + return new GetMetadataChildrenResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataErrors.java index b8b5071b..24036cf7 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetMetadataErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetMetadataErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetMetadataErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetMetadataErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataResponseBody.java new file mode 100644 index 00000000..26e2825a --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMetadataResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetMetadataResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetMetadataResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetMetadataResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMetadataResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetMetadataResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetMetadataResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMetadataResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMetadataResponseBody 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; + } + GetMetadataResponseBody other = (GetMetadataResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMetadataResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetMetadataResponseBody build() { + return new GetMetadataResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMyPlexAccountErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMyPlexAccountErrors.java index 189d257c..56ac78e9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMyPlexAccountErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMyPlexAccountErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetMyPlexAccountErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetMyPlexAccountErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetMyPlexAccountErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetMyPlexAccountErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMyPlexAccountResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMyPlexAccountResponseBody.java new file mode 100644 index 00000000..68e2fc0c --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetMyPlexAccountResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetMyPlexAccountResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetMyPlexAccountResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetMyPlexAccountResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMyPlexAccountResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetMyPlexAccountResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetMyPlexAccountResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMyPlexAccountResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMyPlexAccountResponseBody 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; + } + GetMyPlexAccountResponseBody other = (GetMyPlexAccountResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMyPlexAccountResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetMyPlexAccountResponseBody build() { + return new GetMyPlexAccountResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetOnDeckErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetOnDeckErrors.java index e36927a2..d1f9041c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetOnDeckErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetOnDeckErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetOnDeckErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetOnDeckErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetOnDeckErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetOnDeckErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetOnDeckResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetOnDeckResponseBody.java new file mode 100644 index 00000000..d97cc4c3 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetOnDeckResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetOnDeckResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetOnDeckResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetOnDeckResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetOnDeckResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetOnDeckResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetOnDeckResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetOnDeckResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetOnDeckResponseBody 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; + } + GetOnDeckResponseBody other = (GetOnDeckResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetOnDeckResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetOnDeckResponseBody build() { + return new GetOnDeckResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPinErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPinErrors.java index 49361115..9a6bf355 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPinErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPinErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetPinErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetPinErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetPinErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetPinErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPinResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPinResponseBody.java new file mode 100644 index 00000000..0c3ce466 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPinResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetPinResponseBody - X-Plex-Client-Identifier is missing + */ +public class GetPinResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetPinResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPinResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetPinResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetPinResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPinResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPinResponseBody 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; + } + GetPinResponseBody other = (GetPinResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPinResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetPinResponseBody build() { + return new GetPinResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistContentsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistContentsErrors.java index 50000c86..a7db9de1 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistContentsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetPlaylistContentsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetPlaylistContentsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetPlaylistContentsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetPlaylistContentsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistContentsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistContentsResponseBody.java new file mode 100644 index 00000000..f5edbf22 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistContentsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetPlaylistContentsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetPlaylistContentsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetPlaylistContentsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPlaylistContentsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetPlaylistContentsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetPlaylistContentsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistContentsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistContentsResponseBody 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; + } + GetPlaylistContentsResponseBody other = (GetPlaylistContentsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistContentsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetPlaylistContentsResponseBody build() { + return new GetPlaylistContentsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistErrors.java index 678166d9..5d5da5db 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetPlaylistErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetPlaylistErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetPlaylistErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetPlaylistErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistResponseBody.java new file mode 100644 index 00000000..4a2356db --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetPlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetPlaylistResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetPlaylistResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPlaylistResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetPlaylistResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetPlaylistResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistResponseBody 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; + } + GetPlaylistResponseBody other = (GetPlaylistResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetPlaylistResponseBody build() { + return new GetPlaylistResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistsErrors.java index 73814875..68d1f1ef 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetPlaylistsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetPlaylistsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetPlaylistsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetPlaylistsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistsResponseBody.java new file mode 100644 index 00000000..4243d13c --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetPlaylistsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetPlaylistsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetPlaylistsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetPlaylistsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPlaylistsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetPlaylistsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetPlaylistsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistsResponseBody 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; + } + GetPlaylistsResponseBody other = (GetPlaylistsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetPlaylistsResponseBody build() { + return new GetPlaylistsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetRecentlyAddedErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetRecentlyAddedErrors.java index 1b9b4d6b..0188f62c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetRecentlyAddedErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetRecentlyAddedErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetRecentlyAddedErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetRecentlyAddedErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetRecentlyAddedErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetRecentlyAddedErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetRecentlyAddedResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetRecentlyAddedResponseBody.java new file mode 100644 index 00000000..f415515e --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetRecentlyAddedResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetRecentlyAddedResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetRecentlyAddedResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetRecentlyAddedResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetRecentlyAddedResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetRecentlyAddedResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetRecentlyAddedResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRecentlyAddedResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRecentlyAddedResponseBody 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; + } + GetRecentlyAddedResponseBody other = (GetRecentlyAddedResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetRecentlyAddedResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetRecentlyAddedResponseBody build() { + return new GetRecentlyAddedResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResizedPhotoErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResizedPhotoErrors.java index e8e749c9..b069a637 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResizedPhotoErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetResizedPhotoErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetResizedPhotoErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetResizedPhotoErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetResizedPhotoErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetResizedPhotoErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResizedPhotoResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResizedPhotoResponseBody.java index fa6fbdc8..6e31fb88 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResizedPhotoResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * GetResizedPhotoResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class GetResizedPhotoResponseBody { +public class GetResizedPhotoResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public GetResizedPhotoResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetResizedPhotoResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class GetResizedPhotoResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public GetResizedPhotoResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResizedPhotoResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResizedPhotoResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class GetResizedPhotoResponseBody { return false; } GetResizedPhotoResponseBody other = (GetResizedPhotoResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(GetResizedPhotoResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class GetResizedPhotoResponseBody { 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 GetResizedPhotoResponseBody build() { return new GetResizedPhotoResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResourcesStatisticsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResourcesStatisticsErrors.java new file mode 100644 index 00000000..61e0f383 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResourcesStatisticsErrors.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public GetResourcesStatisticsErrors( + @JsonProperty("code") Optional code, + @JsonProperty("message") Optional message, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(status, "status"); + this.code = code; + this.message = message; + this.status = status; + } + + public GetResourcesStatisticsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetResourcesStatisticsErrors withCode(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public GetResourcesStatisticsErrors withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public GetResourcesStatisticsErrors withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public GetResourcesStatisticsErrors withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public GetResourcesStatisticsErrors withStatus(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResourcesStatisticsErrors other = (GetResourcesStatisticsErrors) o; + return + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + code, + message, + status); + } + + @Override + public String toString() { + return Utils.toString(GetResourcesStatisticsErrors.class, + "code", code, + "message", message, + "status", status); + } + + public final static class Builder { + + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder code(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public Builder code(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder status(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public GetResourcesStatisticsErrors build() { + return new GetResourcesStatisticsErrors( + code, + message, + status); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResourcesStatisticsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResourcesStatisticsResponseBody.java new file mode 100644 index 00000000..cc381e79 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetResourcesStatisticsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetResourcesStatisticsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetResourcesStatisticsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetResourcesStatisticsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetResourcesStatisticsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetResourcesStatisticsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetResourcesStatisticsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResourcesStatisticsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResourcesStatisticsResponseBody 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; + } + GetResourcesStatisticsResponseBody other = (GetResourcesStatisticsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetResourcesStatisticsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetResourcesStatisticsResponseBody build() { + return new GetResourcesStatisticsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSearchResultsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSearchResultsErrors.java index 20427d9e..a8138304 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSearchResultsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetSearchResultsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetSearchResultsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetSearchResultsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetSearchResultsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSearchResultsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSearchResultsResponseBody.java new file mode 100644 index 00000000..d890c786 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSearchResultsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetSearchResultsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetSearchResultsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetSearchResultsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSearchResultsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchResultsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetSearchResultsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchResultsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchResultsResponseBody 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; + } + GetSearchResultsResponseBody other = (GetSearchResultsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSearchResultsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetSearchResultsResponseBody build() { + return new GetSearchResultsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerActivitiesErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerActivitiesErrors.java index a5976201..8095f063 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerActivitiesErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerActivitiesErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetServerActivitiesErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetServerActivitiesErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetServerActivitiesErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetServerActivitiesErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerActivitiesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerActivitiesResponseBody.java new file mode 100644 index 00000000..6e08f84f --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerActivitiesResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetServerActivitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetServerActivitiesResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetServerActivitiesResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerActivitiesResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetServerActivitiesResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetServerActivitiesResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerActivitiesResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerActivitiesResponseBody 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; + } + GetServerActivitiesResponseBody other = (GetServerActivitiesResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerActivitiesResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetServerActivitiesResponseBody build() { + return new GetServerActivitiesResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerCapabilitiesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerCapabilitiesResponseBody.java new file mode 100644 index 00000000..b9fad601 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerCapabilitiesResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetServerCapabilitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetServerCapabilitiesResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetServerCapabilitiesResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerCapabilitiesResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetServerCapabilitiesResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetServerCapabilitiesResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerCapabilitiesResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerCapabilitiesResponseBody 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; + } + GetServerCapabilitiesResponseBody other = (GetServerCapabilitiesResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerCapabilitiesResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetServerCapabilitiesResponseBody build() { + return new GetServerCapabilitiesResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerIdentityErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerIdentityErrors.java index 4791967d..ffe3e888 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerIdentityErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerIdentityErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetServerIdentityErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetServerIdentityErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetServerIdentityErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetServerIdentityErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerIdentityResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerIdentityResponseBody.java new file mode 100644 index 00000000..5589200a --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerIdentityResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetServerIdentityResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetServerIdentityResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetServerIdentityResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerIdentityResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetServerIdentityResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetServerIdentityResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerIdentityResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerIdentityResponseBody 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; + } + GetServerIdentityResponseBody other = (GetServerIdentityResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerIdentityResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetServerIdentityResponseBody build() { + return new GetServerIdentityResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerListErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerListErrors.java index 2049364b..9348e52f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerListErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerListErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetServerListErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetServerListErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetServerListErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetServerListErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerListResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerListResponseBody.java new file mode 100644 index 00000000..146210df --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerListResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetServerListResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetServerListResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetServerListResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerListResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetServerListResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetServerListResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerListResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerListResponseBody 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; + } + GetServerListResponseBody other = (GetServerListResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerListResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetServerListResponseBody build() { + return new GetServerListResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerPreferencesErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerPreferencesErrors.java index f51885f7..cac60541 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerPreferencesErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerPreferencesErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetServerPreferencesErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetServerPreferencesErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetServerPreferencesErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetServerPreferencesErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerPreferencesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerPreferencesResponseBody.java new file mode 100644 index 00000000..2ae84dde --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetServerPreferencesResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetServerPreferencesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetServerPreferencesResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetServerPreferencesResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerPreferencesResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetServerPreferencesResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetServerPreferencesResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerPreferencesResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerPreferencesResponseBody 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; + } + GetServerPreferencesResponseBody other = (GetServerPreferencesResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerPreferencesResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetServerPreferencesResponseBody build() { + return new GetServerPreferencesResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionHistoryErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionHistoryErrors.java index b2d33bab..4ec504f1 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionHistoryErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionHistoryErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetSessionHistoryErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetSessionHistoryErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetSessionHistoryErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetSessionHistoryErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionHistoryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionHistoryResponseBody.java new file mode 100644 index 00000000..6727e55d --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionHistoryResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetSessionHistoryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetSessionHistoryResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetSessionHistoryResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSessionHistoryResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSessionHistoryResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetSessionHistoryResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionHistoryResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionHistoryResponseBody 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; + } + GetSessionHistoryResponseBody other = (GetSessionHistoryResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSessionHistoryResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetSessionHistoryResponseBody build() { + return new GetSessionHistoryResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionsErrors.java index 0c92b5f4..752ead44 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetSessionsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetSessionsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetSessionsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetSessionsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionsResponseBody.java new file mode 100644 index 00000000..a6930e0f --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSessionsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetSessionsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetSessionsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetSessionsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSessionsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSessionsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetSessionsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionsResponseBody 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; + } + GetSessionsResponseBody other = (GetSessionsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSessionsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetSessionsResponseBody build() { + return new GetSessionsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSourceConnectionInformationErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSourceConnectionInformationErrors.java index d00bd941..f834086e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSourceConnectionInformationErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSourceConnectionInformationErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetSourceConnectionInformationErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetSourceConnectionInformationErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetSourceConnectionInformationErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetSourceConnectionInformationErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSourceConnectionInformationResponseBody.java similarity index 53% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSourceConnectionInformationResponseBody.java index 2a2ded3f..0df9724c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetSourceConnectionInformationResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * GetSourceConnectionInformationResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class GetSourceConnectionInformationResponseBody { +public class GetSourceConnectionInformationResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public GetSourceConnectionInformationResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSourceConnectionInformationResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class GetSourceConnectionInformationResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public GetSourceConnectionInformationResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSourceConnectionInformationResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSourceConnectionInformationResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class GetSourceConnectionInformationResponseBody { return false; } GetSourceConnectionInformationResponseBody other = (GetSourceConnectionInformationResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(GetSourceConnectionInformationResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class GetSourceConnectionInformationResponseBody { 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 GetSourceConnectionInformationResponseBody build() { return new GetSourceConnectionInformationResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetStatisticsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetStatisticsErrors.java index b758266d..04fbd168 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetStatisticsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetStatisticsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetStatisticsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetStatisticsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetStatisticsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetStatisticsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetStatisticsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetStatisticsResponseBody.java new file mode 100644 index 00000000..ed03f3d9 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetStatisticsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetStatisticsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetStatisticsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetStatisticsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetStatisticsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetStatisticsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetStatisticsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetStatisticsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetStatisticsResponseBody 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; + } + GetStatisticsResponseBody other = (GetStatisticsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetStatisticsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetStatisticsResponseBody build() { + return new GetStatisticsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTimelineErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTimelineErrors.java index 21f014d5..017bd5c7 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTimelineErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTimelineErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetTimelineErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetTimelineErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetTimelineErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetTimelineErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTimelineResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTimelineResponseBody.java index d8c2070a..66e050a3 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTimelineResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * GetTimelineResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class GetTimelineResponseBody { +public class GetTimelineResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public GetTimelineResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTimelineResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class GetTimelineResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public GetTimelineResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTimelineResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTimelineResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class GetTimelineResponseBody { return false; } GetTimelineResponseBody other = (GetTimelineResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(GetTimelineResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class GetTimelineResponseBody { 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 GetTimelineResponseBody build() { return new GetTimelineResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTokenErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTokenErrors.java index fa5048d1..4da85bf8 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTokenErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTokenErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetTokenErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetTokenErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetTokenErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetTokenErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTokenResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTokenResponseBody.java new file mode 100644 index 00000000..6dc7daa1 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTokenResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetTokenResponseBody - X-Plex-Client-Identifier is missing + */ +public class GetTokenResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetTokenResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTokenResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetTokenResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetTokenResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenResponseBody 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; + } + GetTokenResponseBody other = (GetTokenResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTokenResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetTokenResponseBody build() { + return new GetTokenResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTranscodeSessionsErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTranscodeSessionsErrors.java index 95086177..fad2c81c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTranscodeSessionsErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTranscodeSessionsErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetTranscodeSessionsErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetTranscodeSessionsErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetTranscodeSessionsErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetTranscodeSessionsErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTranscodeSessionsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTranscodeSessionsResponseBody.java new file mode 100644 index 00000000..d4453c9b --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTranscodeSessionsResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetTranscodeSessionsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetTranscodeSessionsResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetTranscodeSessionsResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTranscodeSessionsResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetTranscodeSessionsResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetTranscodeSessionsResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTranscodeSessionsResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTranscodeSessionsResponseBody 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; + } + GetTranscodeSessionsResponseBody other = (GetTranscodeSessionsResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTranscodeSessionsResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetTranscodeSessionsResponseBody build() { + return new GetTranscodeSessionsResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTransientTokenErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTransientTokenErrors.java index 43b2e649..53df23ef 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTransientTokenErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTransientTokenErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetTransientTokenErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetTransientTokenErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetTransientTokenErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetTransientTokenErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTransientTokenResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTransientTokenResponseBody.java index 3e17a193..bbdcfd39 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetTransientTokenResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * GetTransientTokenResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class GetTransientTokenResponseBody { +public class GetTransientTokenResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public GetTransientTokenResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTransientTokenResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class GetTransientTokenResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public GetTransientTokenResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTransientTokenResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTransientTokenResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class GetTransientTokenResponseBody { return false; } GetTransientTokenResponseBody other = (GetTransientTokenResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(GetTransientTokenResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class GetTransientTokenResponseBody { 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 GetTransientTokenResponseBody build() { return new GetTransientTokenResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetUpdateStatusErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/GetUpdateStatusErrors.java index f0dd4a4a..b2f6f297 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetUpdateStatusErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetUpdateStatusErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetUpdateStatusErrors { @JsonProperty("status") private Optional status; + @JsonCreator public GetUpdateStatusErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class GetUpdateStatusErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public GetUpdateStatusErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetUpdateStatusResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetUpdateStatusResponseBody.java new file mode 100644 index 00000000..b9772d86 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetUpdateStatusResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetUpdateStatusResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetUpdateStatusResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetUpdateStatusResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetUpdateStatusResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetUpdateStatusResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetUpdateStatusResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUpdateStatusResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUpdateStatusResponseBody 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; + } + GetUpdateStatusResponseBody other = (GetUpdateStatusResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetUpdateStatusResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetUpdateStatusResponseBody build() { + return new GetUpdateStatusResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetWatchlistErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetWatchlistErrors.java new file mode 100644 index 00000000..7beb28d2 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetWatchlistErrors.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public GetWatchlistErrors( + @JsonProperty("code") Optional code, + @JsonProperty("message") Optional message, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(status, "status"); + this.code = code; + this.message = message; + this.status = status; + } + + public GetWatchlistErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetWatchlistErrors withCode(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public GetWatchlistErrors withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public GetWatchlistErrors withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public GetWatchlistErrors withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public GetWatchlistErrors withStatus(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWatchlistErrors other = (GetWatchlistErrors) o; + return + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + code, + message, + status); + } + + @Override + public String toString() { + return Utils.toString(GetWatchlistErrors.class, + "code", code, + "message", message, + "status", status); + } + + public final static class Builder { + + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder code(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public Builder code(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder status(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public GetWatchlistErrors build() { + return new GetWatchlistErrors( + code, + message, + status); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetWatchlistResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetWatchlistResponseBody.java new file mode 100644 index 00000000..6a3fa6dc --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/GetWatchlistResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * GetWatchlistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetWatchlistResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public GetWatchlistResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetWatchlistResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetWatchlistResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetWatchlistResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetWatchlistResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetWatchlistResponseBody 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; + } + GetWatchlistResponseBody other = (GetWatchlistResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetWatchlistResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 GetWatchlistResponseBody build() { + return new GetWatchlistResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/LogLineErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/LogLineErrors.java index 3acd3093..bc8befba 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/LogLineErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class LogLineErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class LogLineErrors { @JsonProperty("status") private Optional status; + @JsonCreator public LogLineErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class LogLineErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public LogLineErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/LogLineResponseBody.java similarity index 51% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/LogLineResponseBody.java index eccf5bef..b897dd76 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/LogLineResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * LogLineResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class LogLineResponseBody { +public class LogLineResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public LogLineResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public LogLineResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class LogLineResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public LogLineResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogLineResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogLineResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class LogLineResponseBody { return false; } LogLineResponseBody other = (LogLineResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(LogLineResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class LogLineResponseBody { 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 LogLineResponseBody build() { return new LogLineResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/LogMultiLineErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/LogMultiLineErrors.java index 6821c688..6515594a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/LogMultiLineErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class LogMultiLineErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class LogMultiLineErrors { @JsonProperty("status") private Optional status; + @JsonCreator public LogMultiLineErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class LogMultiLineErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public LogMultiLineErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/LogMultiLineResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/LogMultiLineResponseBody.java index 1822a872..b41dd8d0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/LogMultiLineResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * LogMultiLineResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class LogMultiLineResponseBody { +public class LogMultiLineResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public LogMultiLineResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public LogMultiLineResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class LogMultiLineResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public LogMultiLineResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogMultiLineResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogMultiLineResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class LogMultiLineResponseBody { return false; } LogMultiLineResponseBody other = (LogMultiLineResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(LogMultiLineResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class LogMultiLineResponseBody { 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 LogMultiLineResponseBody build() { return new LogMultiLineResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkPlayedErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkPlayedErrors.java index 633f574b..f0eb3d1a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkPlayedErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class MarkPlayedErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class MarkPlayedErrors { @JsonProperty("status") private Optional status; + @JsonCreator public MarkPlayedErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class MarkPlayedErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public MarkPlayedErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkPlayedResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkPlayedResponseBody.java index 76e0b175..4e86f6b2 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkPlayedResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * MarkPlayedResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class MarkPlayedResponseBody { +public class MarkPlayedResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public MarkPlayedResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public MarkPlayedResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class MarkPlayedResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public MarkPlayedResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkPlayedResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkPlayedResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class MarkPlayedResponseBody { return false; } MarkPlayedResponseBody other = (MarkPlayedResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(MarkPlayedResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class MarkPlayedResponseBody { 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 MarkPlayedResponseBody build() { return new MarkPlayedResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkUnplayedErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkUnplayedErrors.java index 62c726ef..5f485d95 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkUnplayedErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class MarkUnplayedErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class MarkUnplayedErrors { @JsonProperty("status") private Optional status; + @JsonCreator public MarkUnplayedErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class MarkUnplayedErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public MarkUnplayedErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkUnplayedResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkUnplayedResponseBody.java index 0cc9f0a4..a83beff9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/MarkUnplayedResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * MarkUnplayedResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class MarkUnplayedResponseBody { +public class MarkUnplayedResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public MarkUnplayedResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public MarkUnplayedResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class MarkUnplayedResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public MarkUnplayedResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkUnplayedResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkUnplayedResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class MarkUnplayedResponseBody { return false; } MarkUnplayedResponseBody other = (MarkUnplayedResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(MarkUnplayedResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class MarkUnplayedResponseBody { 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 MarkUnplayedResponseBody build() { return new MarkUnplayedResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformSearchErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformSearchErrors.java index 854913d2..29ab6a22 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformSearchErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class PerformSearchErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class PerformSearchErrors { @JsonProperty("status") private Optional status; + @JsonCreator public PerformSearchErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class PerformSearchErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public PerformSearchErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformSearchResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformSearchResponseBody.java index 9704055d..ee4978a1 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformSearchResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * PerformSearchResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class PerformSearchResponseBody { +public class PerformSearchResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public PerformSearchResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public PerformSearchResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class PerformSearchResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public PerformSearchResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformSearchResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformSearchResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class PerformSearchResponseBody { return false; } PerformSearchResponseBody other = (PerformSearchResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(PerformSearchResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class PerformSearchResponseBody { 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 PerformSearchResponseBody build() { return new PerformSearchResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformVoiceSearchErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformVoiceSearchErrors.java index fd4dcc25..8369c2e0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformVoiceSearchErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class PerformVoiceSearchErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class PerformVoiceSearchErrors { @JsonProperty("status") private Optional status; + @JsonCreator public PerformVoiceSearchErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class PerformVoiceSearchErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public PerformVoiceSearchErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformVoiceSearchResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformVoiceSearchResponseBody.java index 626c1770..710af69d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/PerformVoiceSearchResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * PerformVoiceSearchResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class PerformVoiceSearchResponseBody { +public class PerformVoiceSearchResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public PerformVoiceSearchResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public PerformVoiceSearchResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class PerformVoiceSearchResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public PerformVoiceSearchResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformVoiceSearchResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformVoiceSearchResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class PerformVoiceSearchResponseBody { return false; } PerformVoiceSearchResponseBody other = (PerformVoiceSearchResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(PerformVoiceSearchResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class PerformVoiceSearchResponseBody { 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 PerformVoiceSearchResponseBody build() { return new PerformVoiceSearchResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/RefreshLibraryErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/RefreshLibraryErrors.java index 434994bd..f434f489 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/RefreshLibraryErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class RefreshLibraryErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class RefreshLibraryErrors { @JsonProperty("status") private Optional status; + @JsonCreator public RefreshLibraryErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class RefreshLibraryErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public RefreshLibraryErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/RefreshLibraryResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/RefreshLibraryResponseBody.java index c4f059e8..a53ed32f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/RefreshLibraryResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * RefreshLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class RefreshLibraryResponseBody { +public class RefreshLibraryResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public RefreshLibraryResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public RefreshLibraryResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class RefreshLibraryResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public RefreshLibraryResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RefreshLibraryResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RefreshLibraryResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class RefreshLibraryResponseBody { return false; } RefreshLibraryResponseBody other = (RefreshLibraryResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(RefreshLibraryResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class RefreshLibraryResponseBody { 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 RefreshLibraryResponseBody build() { return new RefreshLibraryResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/SDKError.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/SDKError.java index e56bca4f..03bdfe4f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/errors/SDKError.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/SDKError.java @@ -11,6 +11,7 @@ import lukehagar.plexapi.plexapi.utils.Utils; /** * Thrown by a service call when an error response occurs. Contains details about the response. */ +@SuppressWarnings("serial") public class SDKError extends Exception { private final HttpResponse rawResponse; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/SearchLibraryErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/SearchLibraryErrors.java new file mode 100644 index 00000000..ff7287e9 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/SearchLibraryErrors.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class SearchLibraryErrors { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("code") + private Optional code; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("message") + private Optional message; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + @JsonCreator + public SearchLibraryErrors( + @JsonProperty("code") Optional code, + @JsonProperty("message") Optional message, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(status, "status"); + this.code = code; + this.message = message; + this.status = status; + } + + public SearchLibraryErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + public final static Builder builder() { + return new Builder(); + } + + public SearchLibraryErrors withCode(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public SearchLibraryErrors withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public SearchLibraryErrors withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public SearchLibraryErrors withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public SearchLibraryErrors withStatus(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public SearchLibraryErrors withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SearchLibraryErrors other = (SearchLibraryErrors) o; + return + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + code, + message, + status); + } + + @Override + public String toString() { + return Utils.toString(SearchLibraryErrors.class, + "code", code, + "message", message, + "status", status); + } + + public final static class Builder { + + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder code(double code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public Builder code(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder status(double status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public SearchLibraryErrors build() { + return new SearchLibraryErrors( + code, + message, + status); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/errors/SearchLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/SearchLibraryResponseBody.java new file mode 100644 index 00000000..f292e3d5 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/SearchLibraryResponseBody.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * SearchLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class SearchLibraryResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator + public SearchLibraryResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public SearchLibraryResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + public Optional> errors(){ + return errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public SearchLibraryResponseBody withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public SearchLibraryResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public SearchLibraryResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public SearchLibraryResponseBody 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; + } + SearchLibraryResponseBody other = (SearchLibraryResponseBody) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(SearchLibraryResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.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 SearchLibraryResponseBody build() { + return new SearchLibraryResponseBody( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartAllTasksErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StartAllTasksErrors.java index 5c6e861e..8a7f794a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartAllTasksErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StartAllTasksErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class StartAllTasksErrors { @JsonProperty("status") private Optional status; + @JsonCreator public StartAllTasksErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class StartAllTasksErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public StartAllTasksErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartAllTasksResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StartAllTasksResponseBody.java index 02a70d6a..63181357 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartAllTasksResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * StartAllTasksResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class StartAllTasksResponseBody { +public class StartAllTasksResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public StartAllTasksResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public StartAllTasksResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class StartAllTasksResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public StartAllTasksResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartAllTasksResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartAllTasksResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class StartAllTasksResponseBody { return false; } StartAllTasksResponseBody other = (StartAllTasksResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(StartAllTasksResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class StartAllTasksResponseBody { 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 StartAllTasksResponseBody build() { return new StartAllTasksResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartTaskErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StartTaskErrors.java index 44e81089..74253502 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartTaskErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StartTaskErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class StartTaskErrors { @JsonProperty("status") private Optional status; + @JsonCreator public StartTaskErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class StartTaskErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public StartTaskErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartTaskResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StartTaskResponseBody.java index 1dd7f864..d8574b53 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartTaskResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * StartTaskResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class StartTaskResponseBody { +public class StartTaskResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public StartTaskResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public StartTaskResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class StartTaskResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public StartTaskResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartTaskResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartTaskResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class StartTaskResponseBody { return false; } StartTaskResponseBody other = (StartTaskResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(StartTaskResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class StartTaskResponseBody { 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 StartTaskResponseBody build() { return new StartTaskResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartUniversalTranscodeErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StartUniversalTranscodeErrors.java index 243a7ecc..3cadb915 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartUniversalTranscodeErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StartUniversalTranscodeErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class StartUniversalTranscodeErrors { @JsonProperty("status") private Optional status; + @JsonCreator public StartUniversalTranscodeErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class StartUniversalTranscodeErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public StartUniversalTranscodeErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartUniversalTranscodeResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StartUniversalTranscodeResponseBody.java index fc04315c..af84337e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StartUniversalTranscodeResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * StartUniversalTranscodeResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class StartUniversalTranscodeResponseBody { +public class StartUniversalTranscodeResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public StartUniversalTranscodeResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public StartUniversalTranscodeResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class StartUniversalTranscodeResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public StartUniversalTranscodeResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartUniversalTranscodeResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartUniversalTranscodeResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class StartUniversalTranscodeResponseBody { return false; } StartUniversalTranscodeResponseBody other = (StartUniversalTranscodeResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(StartUniversalTranscodeResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class StartUniversalTranscodeResponseBody { 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 StartUniversalTranscodeResponseBody build() { return new StartUniversalTranscodeResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopAllTasksErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StopAllTasksErrors.java index f791b5f6..cb94aa93 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopAllTasksErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StopAllTasksErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class StopAllTasksErrors { @JsonProperty("status") private Optional status; + @JsonCreator public StopAllTasksErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class StopAllTasksErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public StopAllTasksErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopAllTasksResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StopAllTasksResponseBody.java index 34cf9de5..18d0d9c0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopAllTasksResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * StopAllTasksResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class StopAllTasksResponseBody { +public class StopAllTasksResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public StopAllTasksResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public StopAllTasksResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class StopAllTasksResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public StopAllTasksResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopAllTasksResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopAllTasksResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class StopAllTasksResponseBody { return false; } StopAllTasksResponseBody other = (StopAllTasksResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(StopAllTasksResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class StopAllTasksResponseBody { 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 StopAllTasksResponseBody build() { return new StopAllTasksResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTaskErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTaskErrors.java index cb67f783..76d95a09 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTaskErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StopTaskErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class StopTaskErrors { @JsonProperty("status") private Optional status; + @JsonCreator public StopTaskErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class StopTaskErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public StopTaskErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTaskResponseBody.java similarity index 51% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTaskResponseBody.java index bf488e3e..48de29be 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTaskResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * StopTaskResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class StopTaskResponseBody { +public class StopTaskResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public StopTaskResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public StopTaskResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class StopTaskResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public StopTaskResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTaskResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTaskResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class StopTaskResponseBody { return false; } StopTaskResponseBody other = (StopTaskResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(StopTaskResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class StopTaskResponseBody { 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 StopTaskResponseBody build() { return new StopTaskResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTranscodeSessionErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTranscodeSessionErrors.java index e8a30128..1d7dc06d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTranscodeSessionErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StopTranscodeSessionErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class StopTranscodeSessionErrors { @JsonProperty("status") private Optional status; + @JsonCreator public StopTranscodeSessionErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class StopTranscodeSessionErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public StopTranscodeSessionErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTranscodeSessionResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTranscodeSessionResponseBody.java index b2c8b0dc..e4983bb4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/StopTranscodeSessionResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * StopTranscodeSessionResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class StopTranscodeSessionResponseBody { +public class StopTranscodeSessionResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public StopTranscodeSessionResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public StopTranscodeSessionResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class StopTranscodeSessionResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public StopTranscodeSessionResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTranscodeSessionResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTranscodeSessionResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class StopTranscodeSessionResponseBody { return false; } StopTranscodeSessionResponseBody other = (StopTranscodeSessionResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(StopTranscodeSessionResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class StopTranscodeSessionResponseBody { 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 StopTranscodeSessionResponseBody build() { return new StopTranscodeSessionResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlayProgressErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlayProgressErrors.java index 4645ea3a..b4c2c7b9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlayProgressErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class UpdatePlayProgressErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class UpdatePlayProgressErrors { @JsonProperty("status") private Optional status; + @JsonCreator public UpdatePlayProgressErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class UpdatePlayProgressErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public UpdatePlayProgressErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlayProgressResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlayProgressResponseBody.java index 5f9f6d8d..64bfee76 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlayProgressResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * UpdatePlayProgressResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class UpdatePlayProgressResponseBody { +public class UpdatePlayProgressResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public UpdatePlayProgressResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public UpdatePlayProgressResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class UpdatePlayProgressResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public UpdatePlayProgressResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlayProgressResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlayProgressResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class UpdatePlayProgressResponseBody { return false; } UpdatePlayProgressResponseBody other = (UpdatePlayProgressResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(UpdatePlayProgressResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class UpdatePlayProgressResponseBody { 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 UpdatePlayProgressResponseBody build() { return new UpdatePlayProgressResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlaylistErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlaylistErrors.java index 518e3146..060ec334 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlaylistErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class UpdatePlaylistErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class UpdatePlaylistErrors { @JsonProperty("status") private Optional status; + @JsonCreator public UpdatePlaylistErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class UpdatePlaylistErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public UpdatePlaylistErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlaylistResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlaylistResponseBody.java index 7cd27b21..17c1b88e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UpdatePlaylistResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * UpdatePlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class UpdatePlaylistResponseBody { +public class UpdatePlaylistResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public UpdatePlaylistResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public UpdatePlaylistResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class UpdatePlaylistResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public UpdatePlaylistResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlaylistResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlaylistResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class UpdatePlaylistResponseBody { return false; } UpdatePlaylistResponseBody other = (UpdatePlaylistResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(UpdatePlaylistResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class UpdatePlaylistResponseBody { 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 UpdatePlaylistResponseBody build() { return new UpdatePlaylistResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistErrors.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UploadPlaylistErrors.java similarity index 88% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistErrors.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/UploadPlaylistErrors.java index 6fd1de9f..af74b8b4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistErrors.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UploadPlaylistErrors.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class UploadPlaylistErrors { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class UploadPlaylistErrors { @JsonProperty("status") private Optional status; + @JsonCreator public UploadPlaylistErrors( @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @@ -42,17 +44,27 @@ public class UploadPlaylistErrors { this.message = message; this.status = status; } - - public Optional code() { - return code; + + public UploadPlaylistErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional message() { - return message; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional message() { + return (Optional) message; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UploadPlaylistResponseBody.java similarity index 52% rename from src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistResponseBody.java rename to src/main/java/lukehagar/plexapi/plexapi/models/errors/UploadPlaylistResponseBody.java index fb70b085..5eb96d1d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/errors/UploadPlaylistResponseBody.java @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -package lukehagar.plexapi.plexapi.models.operations; +package lukehagar.plexapi.plexapi.models.errors; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -13,29 +15,51 @@ import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; /** * UploadPlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ - -public class UploadPlaylistResponseBody { +public class UploadPlaylistResponseBody extends RuntimeException { @JsonInclude(Include.NON_ABSENT) @JsonProperty("errors") private Optional> errors; + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("-") + private Optional> rawResponse; + + @JsonCreator public UploadPlaylistResponseBody( - @JsonProperty("errors") Optional> errors) { + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; + this.rawResponse = rawResponse; + } + + public UploadPlaylistResponseBody() { + this(Optional.empty(), Optional.empty()); } - public Optional> errors() { + public Optional> errors(){ return errors; } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Optional> rawResponse(){ + return rawResponse; + } + public final static Builder builder() { return new Builder(); } @@ -45,13 +69,31 @@ public class UploadPlaylistResponseBody { this.errors = Optional.ofNullable(errors); return this; } - + public UploadPlaylistResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; return this; } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UploadPlaylistResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UploadPlaylistResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,26 +103,31 @@ public class UploadPlaylistResponseBody { return false; } UploadPlaylistResponseBody other = (UploadPlaylistResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } - + @Override public int hashCode() { return java.util.Objects.hash( - errors); + errors, + rawResponse); } - + @Override public String toString() { return Utils.toString(UploadPlaylistResponseBody.class, - "errors", errors); + "errors", errors, + "rawResponse", rawResponse); } - + public final static class Builder { - - private Optional> errors = Optional.empty(); - + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + private Builder() { // force use of static builder() method } @@ -90,17 +137,35 @@ public class UploadPlaylistResponseBody { 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 UploadPlaylistResponseBody build() { return new UploadPlaylistResponseBody( - errors); + errors, + rawResponse); } } } - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Account.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Account.java index d99460f5..f367f5e0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Account.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Account.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Account { @JsonInclude(Include.NON_ABSENT) @@ -51,6 +52,7 @@ public class Account { @JsonProperty("thumb") private Optional thumb; + @JsonCreator public Account( @JsonProperty("id") Optional id, @JsonProperty("key") Optional key, @@ -77,37 +79,57 @@ public class Account { this.subtitleMode = subtitleMode; this.thumb = thumb; } - - public Optional id() { - return id; + + public Account() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional name() { - return name; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional defaultAudioLanguage() { - return defaultAudioLanguage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; } - public Optional autoSelectAudio() { - return autoSelectAudio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional defaultAudioLanguage() { + return (Optional) defaultAudioLanguage; } - public Optional defaultSubtitleLanguage() { - return defaultSubtitleLanguage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional autoSelectAudio() { + return (Optional) autoSelectAudio; } - public Optional subtitleMode() { - return subtitleMode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional defaultSubtitleLanguage() { + return (Optional) defaultSubtitleLanguage; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subtitleMode() { + return (Optional) subtitleMode; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Activity.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Activity.java index 5004c309..62e86624 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Activity.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Activity.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Activity { @JsonInclude(Include.NON_ABSENT) @@ -51,6 +52,7 @@ public class Activity { @JsonProperty("Context") private Optional context; + @JsonCreator public Activity( @JsonProperty("uuid") Optional uuid, @JsonProperty("type") Optional type, @@ -77,37 +79,57 @@ public class Activity { this.progress = progress; this.context = context; } - - public Optional uuid() { - return uuid; + + public Activity() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional uuid() { + return (Optional) uuid; } - public Optional cancellable() { - return cancellable; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional userID() { - return userID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional cancellable() { + return (Optional) cancellable; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userID() { + return (Optional) userID; } - public Optional subtitle() { - return subtitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional progress() { - return progress; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subtitle() { + return (Optional) subtitle; } - public Optional context() { - return context; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional progress() { + return (Optional) progress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional context() { + return (Optional) context; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsMediaContainer.java index a656b777..68a1bff0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class AddPlaylistContentsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -35,6 +36,7 @@ public class AddPlaylistContentsMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public AddPlaylistContentsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("leafCountAdded") Optional leafCountAdded, @@ -49,21 +51,33 @@ public class AddPlaylistContentsMediaContainer { this.leafCountRequested = leafCountRequested; this.metadata = metadata; } - - public Optional size() { - return size; + + public AddPlaylistContentsMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional leafCountAdded() { - return leafCountAdded; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional leafCountRequested() { - return leafCountRequested; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCountAdded() { + return (Optional) leafCountAdded; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCountRequested() { + return (Optional) leafCountRequested; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsMetadata.java index d2af98a2..2a44cda8 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class AddPlaylistContentsMetadata { @JsonInclude(Include.NON_ABSENT) @@ -71,6 +72,7 @@ public class AddPlaylistContentsMetadata { @JsonProperty("updatedAt") private Optional updatedAt; + @JsonCreator public AddPlaylistContentsMetadata( @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("key") Optional key, @@ -112,57 +114,87 @@ public class AddPlaylistContentsMetadata { this.addedAt = addedAt; this.updatedAt = updatedAt; } - - public Optional ratingKey() { - return ratingKey; + + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional smart() { - return smart; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional playlistType() { - return playlistType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional smart() { + return (Optional) smart; } - public Optional composite() { - return composite; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional playlistType() { + return (Optional) playlistType; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional composite() { + return (Optional) composite; } - public Optional leafCount() { - return leafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsPlaylistsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsPlaylistsResponseBody.java deleted file mode 100644 index 2fefb042..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsPlaylistsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * AddPlaylistContentsPlaylistsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class AddPlaylistContentsPlaylistsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public AddPlaylistContentsPlaylistsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public AddPlaylistContentsPlaylistsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public AddPlaylistContentsPlaylistsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AddPlaylistContentsPlaylistsResponseBody other = (AddPlaylistContentsPlaylistsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(AddPlaylistContentsPlaylistsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public AddPlaylistContentsPlaylistsResponseBody build() { - return new AddPlaylistContentsPlaylistsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsRequest.java index 2c7a4a58..414ef883 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class AddPlaylistContentsRequest { /** @@ -35,6 +36,7 @@ public class AddPlaylistContentsRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=playQueueID") private Optional playQueueID; + @JsonCreator public AddPlaylistContentsRequest( double playlistID, String uri, @@ -46,10 +48,17 @@ public class AddPlaylistContentsRequest { this.uri = uri; this.playQueueID = playQueueID; } + + public AddPlaylistContentsRequest( + double playlistID, + String uri) { + this(playlistID, uri, Optional.empty()); + } /** * the ID of the playlist */ + @JsonIgnore public double playlistID() { return playlistID; } @@ -57,6 +66,7 @@ public class AddPlaylistContentsRequest { /** * the content URI for the playlist */ + @JsonIgnore public String uri() { return uri; } @@ -64,8 +74,10 @@ public class AddPlaylistContentsRequest { /** * the play queue to add to a playlist */ - public Optional playQueueID() { - return playQueueID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional playQueueID() { + return (Optional) playQueueID; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsResponse.java index ebad4e96..829d9543 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * Playlist Updated */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public AddPlaylistContentsResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * Playlist Updated */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * Playlist Updated */ - public AddPlaylistContentsResponse withTwoHundredApplicationJsonObject(AddPlaylistContentsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public AddPlaylistContentsResponse withObject(AddPlaylistContentsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Playlist Updated */ - public AddPlaylistContentsResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public AddPlaylistContentsResponse withFourHundredAndOneApplicationJsonObject(AddPlaylistContentsPlaylistsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public AddPlaylistContentsResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public AddPlaylistContentsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * Playlist Updated */ - public Builder twoHundredApplicationJsonObject(AddPlaylistContentsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(AddPlaylistContentsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Playlist Updated */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(AddPlaylistContentsPlaylistsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class AddPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsResponseBody.java index a2df8f7a..4485abff 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/AddPlaylistContentsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * AddPlaylistContentsResponseBody - Playlist Updated */ @@ -26,14 +27,21 @@ public class AddPlaylistContentsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public AddPlaylistContentsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public AddPlaylistContentsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesRequest.java index 6c577f94..17950e45 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class ApplyUpdatesRequest { /** @@ -29,6 +30,7 @@ public class ApplyUpdatesRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=skip") private Optional skip; + @JsonCreator public ApplyUpdatesRequest( Optional tonight, Optional skip) { @@ -37,19 +39,27 @@ public class ApplyUpdatesRequest { this.tonight = tonight; this.skip = skip; } + + public ApplyUpdatesRequest() { + this(Optional.empty(), Optional.empty()); + } /** * 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 */ - public Optional tonight() { - return tonight; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tonight() { + return (Optional) tonight; } /** * Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`. */ - public Optional skip() { - return skip; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional skip() { + return (Optional) skip; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesResponse.java index be0619ab..d51f79d3 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ApplyUpdatesResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class ApplyUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class ApplyUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Res */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public ApplyUpdatesResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class ApplyUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Res /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class ApplyUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Res /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class ApplyUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Res this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public ApplyUpdatesResponse withObject(ApplyUpdatesResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public ApplyUpdatesResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class ApplyUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Res return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class ApplyUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Res return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class ApplyUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Res return Utils.toString(ApplyUpdatesResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class ApplyUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Res private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class ApplyUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Res this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(ApplyUpdatesResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public ApplyUpdatesResponse build() { return new ApplyUpdatesResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ButlerTask.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ButlerTask.java index de737de0..4e708e59 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ButlerTask.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ButlerTask.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class ButlerTask { @JsonInclude(Include.NON_ABSENT) @@ -43,6 +44,7 @@ public class ButlerTask { @JsonProperty("description") private Optional description; + @JsonCreator public ButlerTask( @JsonProperty("name") Optional name, @JsonProperty("interval") Optional interval, @@ -63,29 +65,45 @@ public class ButlerTask { this.title = title; this.description = description; } - - public Optional name() { - return name; + + public ButlerTask() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional interval() { - return interval; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; } - public Optional scheduleRandomized() { - return scheduleRandomized; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional interval() { + return (Optional) interval; } - public Optional enabled() { - return enabled; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional scheduleRandomized() { + return (Optional) scheduleRandomized; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional enabled() { + return (Optional) enabled; } - public Optional description() { - return description; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional description() { + return (Optional) description; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ButlerTasks.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ButlerTasks.java index e65a4d0a..b5e4092f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ButlerTasks.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ButlerTasks.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class ButlerTasks { @JsonInclude(Include.NON_ABSENT) @JsonProperty("ButlerTask") private Optional> butlerTask; + @JsonCreator public ButlerTasks( @JsonProperty("ButlerTask") Optional> butlerTask) { Utils.checkNotNull(butlerTask, "butlerTask"); this.butlerTask = butlerTask; } + + public ButlerTasks() { + this(Optional.empty()); + } - public Optional> butlerTask() { - return butlerTask; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> butlerTask() { + return (Optional>) butlerTask; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesRequest.java index 9c3c821d..61005fb6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class CancelServerActivitiesRequest { /** @@ -22,6 +23,7 @@ public class CancelServerActivitiesRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=activityUUID") private String activityUUID; + @JsonCreator public CancelServerActivitiesRequest( String activityUUID) { Utils.checkNotNull(activityUUID, "activityUUID"); @@ -31,6 +33,7 @@ public class CancelServerActivitiesRequest { /** * The UUID of the activity to cancel. */ + @JsonIgnore public String activityUUID() { return activityUUID; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesResponse.java index 31dd037c..92db5bd2 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CancelServerActivitiesResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class CancelServerActivitiesResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class CancelServerActivitiesResponse implements lukehagar.plexapi.plexapi */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public CancelServerActivitiesResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class CancelServerActivitiesResponse implements lukehagar.plexapi.plexapi /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class CancelServerActivitiesResponse implements lukehagar.plexapi.plexapi /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class CancelServerActivitiesResponse implements lukehagar.plexapi.plexapi this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public CancelServerActivitiesResponse withObject(CancelServerActivitiesResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public CancelServerActivitiesResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class CancelServerActivitiesResponse implements lukehagar.plexapi.plexapi return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class CancelServerActivitiesResponse implements lukehagar.plexapi.plexapi return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class CancelServerActivitiesResponse implements lukehagar.plexapi.plexapi return Utils.toString(CancelServerActivitiesResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class CancelServerActivitiesResponse implements lukehagar.plexapi.plexapi private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class CancelServerActivitiesResponse implements lukehagar.plexapi.plexapi this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(CancelServerActivitiesResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public CancelServerActivitiesResponse build() { return new CancelServerActivitiesResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesRequest.java index f53f2e02..cc319c12 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class CheckForUpdatesRequest { /** @@ -23,17 +24,24 @@ public class CheckForUpdatesRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=download") private Optional download; + @JsonCreator public CheckForUpdatesRequest( Optional download) { Utils.checkNotNull(download, "download"); this.download = download; } + + public CheckForUpdatesRequest() { + this(Optional.empty()); + } /** * Indicate that you want to start download any updates found. */ - public Optional download() { - return download; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional download() { + return (Optional) download; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesResponse.java index b0cdb91a..c08748fd 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CheckForUpdatesResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class CheckForUpdatesResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class CheckForUpdatesResponse implements lukehagar.plexapi.plexapi.utils. */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public CheckForUpdatesResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class CheckForUpdatesResponse implements lukehagar.plexapi.plexapi.utils. /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class CheckForUpdatesResponse implements lukehagar.plexapi.plexapi.utils. /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class CheckForUpdatesResponse implements lukehagar.plexapi.plexapi.utils. this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public CheckForUpdatesResponse withObject(CheckForUpdatesResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public CheckForUpdatesResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class CheckForUpdatesResponse implements lukehagar.plexapi.plexapi.utils. return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class CheckForUpdatesResponse implements lukehagar.plexapi.plexapi.utils. return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class CheckForUpdatesResponse implements lukehagar.plexapi.plexapi.utils. return Utils.toString(CheckForUpdatesResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class CheckForUpdatesResponse implements lukehagar.plexapi.plexapi.utils. private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class CheckForUpdatesResponse implements lukehagar.plexapi.plexapi.utils. this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(CheckForUpdatesResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public CheckForUpdatesResponse build() { return new CheckForUpdatesResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsRequest.java index 76caf774..52830a8c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class ClearPlaylistContentsRequest { /** @@ -22,6 +23,7 @@ public class ClearPlaylistContentsRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=playlistID") private double playlistID; + @JsonCreator public ClearPlaylistContentsRequest( double playlistID) { Utils.checkNotNull(playlistID, "playlistID"); @@ -31,6 +33,7 @@ public class ClearPlaylistContentsRequest { /** * the ID of the playlist */ + @JsonIgnore public double playlistID() { return playlistID; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsResponse.java index f339444f..dc845b85 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/ClearPlaylistContentsResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class ClearPlaylistContentsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class ClearPlaylistContentsResponse implements lukehagar.plexapi.plexapi. */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public ClearPlaylistContentsResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class ClearPlaylistContentsResponse implements lukehagar.plexapi.plexapi. /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class ClearPlaylistContentsResponse implements lukehagar.plexapi.plexapi. /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class ClearPlaylistContentsResponse implements lukehagar.plexapi.plexapi. this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public ClearPlaylistContentsResponse withObject(ClearPlaylistContentsResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public ClearPlaylistContentsResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class ClearPlaylistContentsResponse implements lukehagar.plexapi.plexapi. return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class ClearPlaylistContentsResponse implements lukehagar.plexapi.plexapi. return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class ClearPlaylistContentsResponse implements lukehagar.plexapi.plexapi. return Utils.toString(ClearPlaylistContentsResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class ClearPlaylistContentsResponse implements lukehagar.plexapi.plexapi. private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class ClearPlaylistContentsResponse implements lukehagar.plexapi.plexapi. this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(ClearPlaylistContentsResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public ClearPlaylistContentsResponse build() { return new ClearPlaylistContentsResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Context.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Context.java index e5603c91..1d6e528d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Context.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Context.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Context { @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonCreator public Context( @JsonProperty("librarySectionID") Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; } + + public Context() { + this(Optional.empty()); + } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Country.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Country.java index dacc6a77..272c0640 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Country.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Country.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Country { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public Country( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public Country() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistMediaContainer.java index aa3a59db..ae93834f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class CreatePlaylistMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class CreatePlaylistMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public CreatePlaylistMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("Metadata") Optional> metadata) { @@ -35,13 +37,21 @@ public class CreatePlaylistMediaContainer { this.size = size; this.metadata = metadata; } - - public Optional size() { - return size; + + public CreatePlaylistMediaContainer() { + this(Optional.empty(), Optional.empty()); } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistMetadata.java index 785fd024..c2bff368 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class CreatePlaylistMetadata { @JsonInclude(Include.NON_ABSENT) @@ -83,6 +84,7 @@ public class CreatePlaylistMetadata { @JsonProperty("duration") private Optional duration; + @JsonCreator public CreatePlaylistMetadata( @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("key") Optional key, @@ -133,69 +135,105 @@ public class CreatePlaylistMetadata { this.composite = composite; this.duration = duration; } - - public Optional ratingKey() { - return ratingKey; + + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional smart() { - return smart; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional playlistType() { - return playlistType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional smart() { + return (Optional) smart; } - public Optional icon() { - return icon; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional playlistType() { + return (Optional) playlistType; } - public Optional viewCount() { - return viewCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional icon() { + return (Optional) icon; } - public Optional lastViewedAt() { - return lastViewedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewCount() { + return (Optional) viewCount; } - public Optional leafCount() { - return leafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastViewedAt() { + return (Optional) lastViewedAt; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; } - public Optional composite() { - return composite; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional composite() { + return (Optional) composite; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistPlaylistsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistPlaylistsResponseBody.java deleted file mode 100644 index 05473570..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistPlaylistsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * CreatePlaylistPlaylistsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class CreatePlaylistPlaylistsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public CreatePlaylistPlaylistsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public CreatePlaylistPlaylistsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public CreatePlaylistPlaylistsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreatePlaylistPlaylistsResponseBody other = (CreatePlaylistPlaylistsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(CreatePlaylistPlaylistsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public CreatePlaylistPlaylistsResponseBody build() { - return new CreatePlaylistPlaylistsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistRequest.java index 48474b48..7978d402 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class CreatePlaylistRequest { /** @@ -47,6 +48,7 @@ public class CreatePlaylistRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=playQueueID") private Optional playQueueID; + @JsonCreator public CreatePlaylistRequest( String title, QueryParamType type, @@ -64,10 +66,19 @@ public class CreatePlaylistRequest { this.uri = uri; this.playQueueID = playQueueID; } + + public CreatePlaylistRequest( + String title, + QueryParamType type, + Smart smart, + String uri) { + this(title, type, smart, uri, Optional.empty()); + } /** * name of the playlist */ + @JsonIgnore public String title() { return title; } @@ -75,6 +86,7 @@ public class CreatePlaylistRequest { /** * type of playlist to create */ + @JsonIgnore public QueryParamType type() { return type; } @@ -82,6 +94,7 @@ public class CreatePlaylistRequest { /** * whether the playlist is smart or not */ + @JsonIgnore public Smart smart() { return smart; } @@ -89,6 +102,7 @@ public class CreatePlaylistRequest { /** * the content URI for the playlist */ + @JsonIgnore public String uri() { return uri; } @@ -96,8 +110,10 @@ public class CreatePlaylistRequest { /** * the play queue to copy to a playlist */ - public Optional playQueueID() { - return playQueueID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional playQueueID() { + return (Optional) playQueueID; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistResponse.java index 2819e744..30f531d3 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * returns all playlists */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public CreatePlaylistResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * returns all playlists */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * returns all playlists */ - public CreatePlaylistResponse withTwoHundredApplicationJsonObject(CreatePlaylistResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public CreatePlaylistResponse withObject(CreatePlaylistResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * returns all playlists */ - public CreatePlaylistResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public CreatePlaylistResponse withFourHundredAndOneApplicationJsonObject(CreatePlaylistPlaylistsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public CreatePlaylistResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public CreatePlaylistResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * returns all playlists */ - public Builder twoHundredApplicationJsonObject(CreatePlaylistResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(CreatePlaylistResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * returns all playlists */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(CreatePlaylistPlaylistsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class CreatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistResponseBody.java index 19cff6fe..3250a628 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/CreatePlaylistResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * CreatePlaylistResponseBody - returns all playlists */ @@ -26,14 +27,21 @@ public class CreatePlaylistResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public CreatePlaylistResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public CreatePlaylistResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryRequest.java index 28b1550a..8ca98ca8 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class DeleteLibraryRequest { /** @@ -22,6 +23,7 @@ public class DeleteLibraryRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionId") private double sectionId; + @JsonCreator public DeleteLibraryRequest( double sectionId) { Utils.checkNotNull(sectionId, "sectionId"); @@ -31,6 +33,7 @@ public class DeleteLibraryRequest { /** * the Id of the library to query */ + @JsonIgnore public double sectionId() { return sectionId; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryResponse.java index 002bb8bc..140a8f45 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeleteLibraryResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class DeleteLibraryResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class DeleteLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public DeleteLibraryResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class DeleteLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class DeleteLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class DeleteLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public DeleteLibraryResponse withObject(DeleteLibraryResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public DeleteLibraryResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class DeleteLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class DeleteLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class DeleteLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re return Utils.toString(DeleteLibraryResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class DeleteLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class DeleteLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(DeleteLibraryResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public DeleteLibraryResponse build() { return new DeleteLibraryResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistRequest.java index 64e4508b..0b07d522 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class DeletePlaylistRequest { /** @@ -22,6 +23,7 @@ public class DeletePlaylistRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=playlistID") private double playlistID; + @JsonCreator public DeletePlaylistRequest( double playlistID) { Utils.checkNotNull(playlistID, "playlistID"); @@ -31,6 +33,7 @@ public class DeletePlaylistRequest { /** * the ID of the playlist */ + @JsonIgnore public double playlistID() { return playlistID; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistResponse.java index 8a34ba8c..b4a1fa50 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/DeletePlaylistResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class DeletePlaylistResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class DeletePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public DeletePlaylistResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class DeletePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class DeletePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class DeletePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public DeletePlaylistResponse withObject(DeletePlaylistResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public DeletePlaylistResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class DeletePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class DeletePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class DeletePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R return Utils.toString(DeletePlaylistResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class DeletePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class DeletePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(DeletePlaylistResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public DeletePlaylistResponse build() { return new DeletePlaylistResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Device.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Device.java index eeafaa25..52955c43 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Device.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Device.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Device { @JsonInclude(Include.NON_ABSENT) @@ -39,6 +40,7 @@ public class Device { @JsonProperty("createdAt") private Optional createdAt; + @JsonCreator public Device( @JsonProperty("id") Optional id, @JsonProperty("name") Optional name, @@ -56,25 +58,39 @@ public class Device { this.clientIdentifier = clientIdentifier; this.createdAt = createdAt; } - - public Optional id() { - return id; + + public Device() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional name() { - return name; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional platform() { - return platform; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; } - public Optional clientIdentifier() { - return clientIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platform() { + return (Optional) platform; } - public Optional createdAt() { - return createdAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional clientIdentifier() { + return (Optional) clientIdentifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Director.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Director.java index 9f418323..63661e1c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Director.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Director.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Director { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public Director( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public Director() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Directory.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Directory.java index dbf4051b..17e4fce4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Directory.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Directory.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Directory { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class Directory { @JsonProperty("title") private Optional title; + @JsonCreator public Directory( @JsonProperty("count") Optional count, @JsonProperty("key") Optional key, @@ -42,17 +44,27 @@ public class Directory { this.key = key; this.title = title; } - - public Optional count() { - return count; + + public Directory() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional count() { + return (Optional) count; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Download.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Download.java index 1b83489d..adc0f62a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Download.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Download.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailResponse.java index c737e490..04349d9f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/EnablePaperTrailResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class EnablePaperTrailResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class EnablePaperTrailResponse implements lukehagar.plexapi.plexapi.utils */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public EnablePaperTrailResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class EnablePaperTrailResponse implements lukehagar.plexapi.plexapi.utils /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class EnablePaperTrailResponse implements lukehagar.plexapi.plexapi.utils /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class EnablePaperTrailResponse implements lukehagar.plexapi.plexapi.utils this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public EnablePaperTrailResponse withObject(EnablePaperTrailResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public EnablePaperTrailResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class EnablePaperTrailResponse implements lukehagar.plexapi.plexapi.utils return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class EnablePaperTrailResponse implements lukehagar.plexapi.plexapi.utils return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class EnablePaperTrailResponse implements lukehagar.plexapi.plexapi.utils return Utils.toString(EnablePaperTrailResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class EnablePaperTrailResponse implements lukehagar.plexapi.plexapi.utils private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class EnablePaperTrailResponse implements lukehagar.plexapi.plexapi.utils this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(EnablePaperTrailResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public EnablePaperTrailResponse build() { return new EnablePaperTrailResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Field.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Field.java index b737d728..b999837b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Field.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Field.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Field { @JsonInclude(Include.NON_ABSENT) @@ -35,6 +36,7 @@ public class Field { @JsonProperty("subType") private Optional subType; + @JsonCreator public Field( @JsonProperty("key") Optional key, @JsonProperty("title") Optional title, @@ -49,21 +51,33 @@ public class Field { this.type = type; this.subType = subType; } - - public Optional key() { - return key; + + public Field() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional subType() { - return subType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subType() { + return (Optional) subType; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/FieldType.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/FieldType.java index 4150aca8..cada09db 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/FieldType.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/FieldType.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class FieldType { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class FieldType { @JsonProperty("Operator") private Optional> operator; + @JsonCreator public FieldType( @JsonProperty("type") Optional type, @JsonProperty("Operator") Optional> operator) { @@ -35,13 +37,21 @@ public class FieldType { this.type = type; this.operator = operator; } - - public Optional type() { - return type; + + public FieldType() { + this(Optional.empty(), Optional.empty()); } - public Optional> operator() { - return operator; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> operator() { + return (Optional>) operator; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Filter.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Filter.java index 17075d08..bb0f7f06 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Filter.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Filter.java @@ -4,142 +4,32 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - +/** + * Filter - Filters content by field and direction/equality + * (Unknown if viewedAt is the only supported column) + * + */ public class Filter { - @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; - - public Filter( - @JsonProperty("filter") Optional filter, - @JsonProperty("filterType") Optional filterType, - @JsonProperty("key") Optional key, - @JsonProperty("title") Optional title, - @JsonProperty("type") Optional type) { - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(filterType, "filterType"); - Utils.checkNotNull(key, "key"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(type, "type"); - this.filter = filter; - this.filterType = filterType; - this.key = key; - this.title = title; - this.type = type; - } - - public Optional filter() { - return filter; - } - - public Optional filterType() { - return filterType; - } - - public Optional key() { - return key; - } - - public Optional title() { - return title; - } - - public Optional type() { - return type; + @JsonCreator + public Filter() { + + } public final static Builder builder() { return new Builder(); } - - public Filter withFilter(String filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - public Filter withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = filter; - return this; - } - - public Filter withFilterType(String filterType) { - Utils.checkNotNull(filterType, "filterType"); - this.filterType = Optional.ofNullable(filterType); - return this; - } - - public Filter withFilterType(Optional filterType) { - Utils.checkNotNull(filterType, "filterType"); - this.filterType = filterType; - return this; - } - - public Filter withKey(String key) { - Utils.checkNotNull(key, "key"); - this.key = Optional.ofNullable(key); - return this; - } - - public Filter withKey(Optional key) { - Utils.checkNotNull(key, "key"); - this.key = key; - return this; - } - - public Filter withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - public Filter withTitle(Optional title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - public Filter withType(String type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Filter withType(Optional type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -149,118 +39,29 @@ public class Filter { if (o == null || getClass() != o.getClass()) { return false; } - Filter other = (Filter) o; - return - java.util.Objects.deepEquals(this.filter, other.filter) && - java.util.Objects.deepEquals(this.filterType, other.filterType) && - java.util.Objects.deepEquals(this.key, other.key) && - java.util.Objects.deepEquals(this.title, other.title) && - java.util.Objects.deepEquals(this.type, other.type); + return true; } @Override public int hashCode() { return java.util.Objects.hash( - filter, - filterType, - key, - title, - type); + ); } @Override public String toString() { - return Utils.toString(Filter.class, - "filter", filter, - "filterType", filterType, - "key", key, - "title", title, - "type", type); + return Utils.toString(Filter.class); } - 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(); + public final static class Builder { private Builder() { // force use of static builder() method } - - public Builder filter(String filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = filter; - return this; - } - - public Builder filterType(String filterType) { - Utils.checkNotNull(filterType, "filterType"); - this.filterType = Optional.ofNullable(filterType); - return this; - } - - public Builder filterType(Optional filterType) { - Utils.checkNotNull(filterType, "filterType"); - this.filterType = filterType; - return this; - } - - public Builder key(String key) { - Utils.checkNotNull(key, "key"); - this.key = Optional.ofNullable(key); - return this; - } - - public Builder key(Optional key) { - Utils.checkNotNull(key, "key"); - this.key = key; - return this; - } - - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - public Builder type(String type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } public Filter build() { return new Filter( - filter, - filterType, - key, - title, - type); + ); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Force.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Force.java index 6c4b4770..82ea74a4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Force.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Force.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Genre.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Genre.java index 03d22ac8..c9206374 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Genre.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Genre.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Genre { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public Genre( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public Genre() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsMediaContainer.java index 1a6db616..5011c7ce 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetAvailableClientsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class GetAvailableClientsMediaContainer { @JsonProperty("Server") private Optional> server; + @JsonCreator public GetAvailableClientsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("Server") Optional> server) { @@ -35,13 +37,21 @@ public class GetAvailableClientsMediaContainer { this.size = size; this.server = server; } - - public Optional size() { - return size; + + public GetAvailableClientsMediaContainer() { + this(Optional.empty(), Optional.empty()); } - public Optional> server() { - return server; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> server() { + return (Optional>) server; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsResponse.java index 9f8a42be..9e772e64 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut /** * Available Clients */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetAvailableClientsResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut /** * Available Clients */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut /** * Available Clients */ - public GetAvailableClientsResponse withTwoHundredApplicationJsonObject(GetAvailableClientsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetAvailableClientsResponse withObject(GetAvailableClientsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Available Clients */ - public GetAvailableClientsResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetAvailableClientsResponse withFourHundredAndOneApplicationJsonObject(GetAvailableClientsServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetAvailableClientsResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetAvailableClientsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut /** * Available Clients */ - public Builder twoHundredApplicationJsonObject(GetAvailableClientsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetAvailableClientsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Available Clients */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetAvailableClientsServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetAvailableClientsResponse implements lukehagar.plexapi.plexapi.ut contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsResponseBody.java index f1d9dc97..678bf7f3 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetAvailableClientsResponseBody - Available Clients */ @@ -26,14 +27,21 @@ public class GetAvailableClientsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetAvailableClientsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetAvailableClientsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsServerResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsServerResponseBody.java deleted file mode 100644 index 06d5341a..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetAvailableClientsServerResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetAvailableClientsServerResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetAvailableClientsServerResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetAvailableClientsServerResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetAvailableClientsServerResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetAvailableClientsServerResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAvailableClientsServerResponseBody other = (GetAvailableClientsServerResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetAvailableClientsServerResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetAvailableClientsServerResponseBody build() { - return new GetAvailableClientsServerResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsAccount.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsAccount.java new file mode 100644 index 00000000..f6d92eb0 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsAccount.java @@ -0,0 +1,412 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetBandwidthStatisticsAccount { + + @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; + + @JsonCreator + public GetBandwidthStatisticsAccount( + @JsonProperty("id") Optional id, + @JsonProperty("key") Optional key, + @JsonProperty("name") Optional name, + @JsonProperty("defaultAudioLanguage") Optional defaultAudioLanguage, + @JsonProperty("autoSelectAudio") Optional autoSelectAudio, + @JsonProperty("defaultSubtitleLanguage") Optional defaultSubtitleLanguage, + @JsonProperty("subtitleMode") Optional subtitleMode, + @JsonProperty("thumb") Optional thumb) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(defaultAudioLanguage, "defaultAudioLanguage"); + Utils.checkNotNull(autoSelectAudio, "autoSelectAudio"); + Utils.checkNotNull(defaultSubtitleLanguage, "defaultSubtitleLanguage"); + Utils.checkNotNull(subtitleMode, "subtitleMode"); + Utils.checkNotNull(thumb, "thumb"); + this.id = id; + this.key = key; + this.name = name; + this.defaultAudioLanguage = defaultAudioLanguage; + this.autoSelectAudio = autoSelectAudio; + this.defaultSubtitleLanguage = defaultSubtitleLanguage; + this.subtitleMode = subtitleMode; + this.thumb = thumb; + } + + public GetBandwidthStatisticsAccount() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional defaultAudioLanguage() { + return (Optional) defaultAudioLanguage; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional autoSelectAudio() { + return (Optional) autoSelectAudio; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional defaultSubtitleLanguage() { + return (Optional) defaultSubtitleLanguage; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subtitleMode() { + return (Optional) subtitleMode; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetBandwidthStatisticsAccount withId(int id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public GetBandwidthStatisticsAccount withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetBandwidthStatisticsAccount withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = Optional.ofNullable(key); + return this; + } + + public GetBandwidthStatisticsAccount withKey(Optional key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetBandwidthStatisticsAccount withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + public GetBandwidthStatisticsAccount withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public GetBandwidthStatisticsAccount withDefaultAudioLanguage(String defaultAudioLanguage) { + Utils.checkNotNull(defaultAudioLanguage, "defaultAudioLanguage"); + this.defaultAudioLanguage = Optional.ofNullable(defaultAudioLanguage); + return this; + } + + public GetBandwidthStatisticsAccount withDefaultAudioLanguage(Optional defaultAudioLanguage) { + Utils.checkNotNull(defaultAudioLanguage, "defaultAudioLanguage"); + this.defaultAudioLanguage = defaultAudioLanguage; + return this; + } + + public GetBandwidthStatisticsAccount withAutoSelectAudio(boolean autoSelectAudio) { + Utils.checkNotNull(autoSelectAudio, "autoSelectAudio"); + this.autoSelectAudio = Optional.ofNullable(autoSelectAudio); + return this; + } + + public GetBandwidthStatisticsAccount withAutoSelectAudio(Optional autoSelectAudio) { + Utils.checkNotNull(autoSelectAudio, "autoSelectAudio"); + this.autoSelectAudio = autoSelectAudio; + return this; + } + + public GetBandwidthStatisticsAccount withDefaultSubtitleLanguage(String defaultSubtitleLanguage) { + Utils.checkNotNull(defaultSubtitleLanguage, "defaultSubtitleLanguage"); + this.defaultSubtitleLanguage = Optional.ofNullable(defaultSubtitleLanguage); + return this; + } + + public GetBandwidthStatisticsAccount withDefaultSubtitleLanguage(Optional defaultSubtitleLanguage) { + Utils.checkNotNull(defaultSubtitleLanguage, "defaultSubtitleLanguage"); + this.defaultSubtitleLanguage = defaultSubtitleLanguage; + return this; + } + + public GetBandwidthStatisticsAccount withSubtitleMode(int subtitleMode) { + Utils.checkNotNull(subtitleMode, "subtitleMode"); + this.subtitleMode = Optional.ofNullable(subtitleMode); + return this; + } + + public GetBandwidthStatisticsAccount withSubtitleMode(Optional subtitleMode) { + Utils.checkNotNull(subtitleMode, "subtitleMode"); + this.subtitleMode = subtitleMode; + return this; + } + + public GetBandwidthStatisticsAccount withThumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public GetBandwidthStatisticsAccount withThumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBandwidthStatisticsAccount other = (GetBandwidthStatisticsAccount) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.key, other.key) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.defaultAudioLanguage, other.defaultAudioLanguage) && + java.util.Objects.deepEquals(this.autoSelectAudio, other.autoSelectAudio) && + java.util.Objects.deepEquals(this.defaultSubtitleLanguage, other.defaultSubtitleLanguage) && + java.util.Objects.deepEquals(this.subtitleMode, other.subtitleMode) && + java.util.Objects.deepEquals(this.thumb, other.thumb); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + key, + name, + defaultAudioLanguage, + autoSelectAudio, + defaultSubtitleLanguage, + subtitleMode, + thumb); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsAccount.class, + "id", id, + "key", key, + "name", name, + "defaultAudioLanguage", defaultAudioLanguage, + "autoSelectAudio", autoSelectAudio, + "defaultSubtitleLanguage", defaultSubtitleLanguage, + "subtitleMode", subtitleMode, + "thumb", thumb); + } + + 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); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = Optional.ofNullable(key); + return this; + } + + public Builder key(Optional key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder defaultAudioLanguage(String defaultAudioLanguage) { + Utils.checkNotNull(defaultAudioLanguage, "defaultAudioLanguage"); + this.defaultAudioLanguage = Optional.ofNullable(defaultAudioLanguage); + return this; + } + + public Builder defaultAudioLanguage(Optional defaultAudioLanguage) { + Utils.checkNotNull(defaultAudioLanguage, "defaultAudioLanguage"); + this.defaultAudioLanguage = defaultAudioLanguage; + return this; + } + + public Builder autoSelectAudio(boolean autoSelectAudio) { + Utils.checkNotNull(autoSelectAudio, "autoSelectAudio"); + this.autoSelectAudio = Optional.ofNullable(autoSelectAudio); + return this; + } + + public Builder autoSelectAudio(Optional autoSelectAudio) { + Utils.checkNotNull(autoSelectAudio, "autoSelectAudio"); + this.autoSelectAudio = autoSelectAudio; + return this; + } + + public Builder defaultSubtitleLanguage(String defaultSubtitleLanguage) { + Utils.checkNotNull(defaultSubtitleLanguage, "defaultSubtitleLanguage"); + this.defaultSubtitleLanguage = Optional.ofNullable(defaultSubtitleLanguage); + return this; + } + + public Builder defaultSubtitleLanguage(Optional defaultSubtitleLanguage) { + Utils.checkNotNull(defaultSubtitleLanguage, "defaultSubtitleLanguage"); + this.defaultSubtitleLanguage = defaultSubtitleLanguage; + return this; + } + + public Builder subtitleMode(int subtitleMode) { + Utils.checkNotNull(subtitleMode, "subtitleMode"); + this.subtitleMode = Optional.ofNullable(subtitleMode); + return this; + } + + public Builder subtitleMode(Optional subtitleMode) { + Utils.checkNotNull(subtitleMode, "subtitleMode"); + this.subtitleMode = subtitleMode; + return this; + } + + public Builder thumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public Builder thumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public GetBandwidthStatisticsAccount build() { + return new GetBandwidthStatisticsAccount( + id, + key, + name, + defaultAudioLanguage, + autoSelectAudio, + defaultSubtitleLanguage, + subtitleMode, + thumb); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsDevice.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsDevice.java new file mode 100644 index 00000000..3fd6d871 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsDevice.java @@ -0,0 +1,283 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetBandwidthStatisticsDevice { + + @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; + + @JsonCreator + public GetBandwidthStatisticsDevice( + @JsonProperty("id") Optional id, + @JsonProperty("name") Optional name, + @JsonProperty("platform") Optional platform, + @JsonProperty("clientIdentifier") Optional clientIdentifier, + @JsonProperty("createdAt") Optional createdAt) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(platform, "platform"); + Utils.checkNotNull(clientIdentifier, "clientIdentifier"); + Utils.checkNotNull(createdAt, "createdAt"); + this.id = id; + this.name = name; + this.platform = platform; + this.clientIdentifier = clientIdentifier; + this.createdAt = createdAt; + } + + public GetBandwidthStatisticsDevice() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platform() { + return (Optional) platform; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional clientIdentifier() { + return (Optional) clientIdentifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetBandwidthStatisticsDevice withId(int id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public GetBandwidthStatisticsDevice withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetBandwidthStatisticsDevice withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + public GetBandwidthStatisticsDevice withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public GetBandwidthStatisticsDevice withPlatform(String platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = Optional.ofNullable(platform); + return this; + } + + public GetBandwidthStatisticsDevice withPlatform(Optional platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = platform; + return this; + } + + public GetBandwidthStatisticsDevice withClientIdentifier(String clientIdentifier) { + Utils.checkNotNull(clientIdentifier, "clientIdentifier"); + this.clientIdentifier = Optional.ofNullable(clientIdentifier); + return this; + } + + public GetBandwidthStatisticsDevice withClientIdentifier(Optional clientIdentifier) { + Utils.checkNotNull(clientIdentifier, "clientIdentifier"); + this.clientIdentifier = clientIdentifier; + return this; + } + + public GetBandwidthStatisticsDevice withCreatedAt(int createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + public GetBandwidthStatisticsDevice withCreatedAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBandwidthStatisticsDevice other = (GetBandwidthStatisticsDevice) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.platform, other.platform) && + java.util.Objects.deepEquals(this.clientIdentifier, other.clientIdentifier) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name, + platform, + clientIdentifier, + createdAt); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsDevice.class, + "id", id, + "name", name, + "platform", platform, + "clientIdentifier", clientIdentifier, + "createdAt", createdAt); + } + + 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); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder platform(String platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = Optional.ofNullable(platform); + return this; + } + + public Builder platform(Optional platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = platform; + return this; + } + + public Builder clientIdentifier(String clientIdentifier) { + Utils.checkNotNull(clientIdentifier, "clientIdentifier"); + this.clientIdentifier = Optional.ofNullable(clientIdentifier); + return this; + } + + public Builder clientIdentifier(Optional clientIdentifier) { + Utils.checkNotNull(clientIdentifier, "clientIdentifier"); + this.clientIdentifier = clientIdentifier; + return this; + } + + public Builder createdAt(int createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + public Builder createdAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public GetBandwidthStatisticsDevice build() { + return new GetBandwidthStatisticsDevice( + id, + name, + platform, + clientIdentifier, + createdAt); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsMediaContainer.java new file mode 100644 index 00000000..c7176e19 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsMediaContainer.java @@ -0,0 +1,240 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetBandwidthStatisticsMediaContainer { + + @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("StatisticsBandwidth") + private Optional> statisticsBandwidth; + + @JsonCreator + public GetBandwidthStatisticsMediaContainer( + @JsonProperty("size") Optional size, + @JsonProperty("Device") Optional> device, + @JsonProperty("Account") Optional> account, + @JsonProperty("StatisticsBandwidth") Optional> statisticsBandwidth) { + Utils.checkNotNull(size, "size"); + Utils.checkNotNull(device, "device"); + Utils.checkNotNull(account, "account"); + Utils.checkNotNull(statisticsBandwidth, "statisticsBandwidth"); + this.size = size; + this.device = device; + this.account = account; + this.statisticsBandwidth = statisticsBandwidth; + } + + public GetBandwidthStatisticsMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> device() { + return (Optional>) device; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> account() { + return (Optional>) account; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> statisticsBandwidth() { + return (Optional>) statisticsBandwidth; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetBandwidthStatisticsMediaContainer withSize(int size) { + Utils.checkNotNull(size, "size"); + this.size = Optional.ofNullable(size); + return this; + } + + public GetBandwidthStatisticsMediaContainer withSize(Optional size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + public GetBandwidthStatisticsMediaContainer withDevice(java.util.List device) { + Utils.checkNotNull(device, "device"); + this.device = Optional.ofNullable(device); + return this; + } + + public GetBandwidthStatisticsMediaContainer withDevice(Optional> device) { + Utils.checkNotNull(device, "device"); + this.device = device; + return this; + } + + public GetBandwidthStatisticsMediaContainer withAccount(java.util.List account) { + Utils.checkNotNull(account, "account"); + this.account = Optional.ofNullable(account); + return this; + } + + public GetBandwidthStatisticsMediaContainer withAccount(Optional> account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + public GetBandwidthStatisticsMediaContainer withStatisticsBandwidth(java.util.List statisticsBandwidth) { + Utils.checkNotNull(statisticsBandwidth, "statisticsBandwidth"); + this.statisticsBandwidth = Optional.ofNullable(statisticsBandwidth); + return this; + } + + public GetBandwidthStatisticsMediaContainer withStatisticsBandwidth(Optional> statisticsBandwidth) { + Utils.checkNotNull(statisticsBandwidth, "statisticsBandwidth"); + this.statisticsBandwidth = statisticsBandwidth; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBandwidthStatisticsMediaContainer other = (GetBandwidthStatisticsMediaContainer) o; + return + java.util.Objects.deepEquals(this.size, other.size) && + java.util.Objects.deepEquals(this.device, other.device) && + java.util.Objects.deepEquals(this.account, other.account) && + java.util.Objects.deepEquals(this.statisticsBandwidth, other.statisticsBandwidth); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + size, + device, + account, + statisticsBandwidth); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsMediaContainer.class, + "size", size, + "device", device, + "account", account, + "statisticsBandwidth", statisticsBandwidth); + } + + public final static class Builder { + + private Optional size = Optional.empty(); + + private Optional> device = Optional.empty(); + + private Optional> account = Optional.empty(); + + private Optional> statisticsBandwidth = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder size(int size) { + Utils.checkNotNull(size, "size"); + this.size = Optional.ofNullable(size); + return this; + } + + public Builder size(Optional size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + public Builder device(java.util.List device) { + Utils.checkNotNull(device, "device"); + this.device = Optional.ofNullable(device); + return this; + } + + public Builder device(Optional> device) { + Utils.checkNotNull(device, "device"); + this.device = device; + return this; + } + + public Builder account(java.util.List account) { + Utils.checkNotNull(account, "account"); + this.account = Optional.ofNullable(account); + return this; + } + + public Builder account(Optional> account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + public Builder statisticsBandwidth(java.util.List statisticsBandwidth) { + Utils.checkNotNull(statisticsBandwidth, "statisticsBandwidth"); + this.statisticsBandwidth = Optional.ofNullable(statisticsBandwidth); + return this; + } + + public Builder statisticsBandwidth(Optional> statisticsBandwidth) { + Utils.checkNotNull(statisticsBandwidth, "statisticsBandwidth"); + this.statisticsBandwidth = statisticsBandwidth; + return this; + } + + public GetBandwidthStatisticsMediaContainer build() { + return new GetBandwidthStatisticsMediaContainer( + size, + device, + account, + statisticsBandwidth); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsRequest.java new file mode 100644 index 00000000..ae0da93a --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsRequest.java @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetBandwidthStatisticsRequest { + + /** + * The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=Timespan") + private Optional timespan; + + @JsonCreator + public GetBandwidthStatisticsRequest( + Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + } + + public GetBandwidthStatisticsRequest() { + this(Optional.empty()); + } + + /** + * The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional timespan() { + return (Optional) timespan; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + */ + public GetBandwidthStatisticsRequest withTimespan(long timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = Optional.ofNullable(timespan); + return this; + } + + /** + * The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + */ + public GetBandwidthStatisticsRequest withTimespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBandwidthStatisticsRequest other = (GetBandwidthStatisticsRequest) o; + return + java.util.Objects.deepEquals(this.timespan, other.timespan); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + timespan); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsRequest.class, + "timespan", timespan); + } + + 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 + * + */ + public Builder timespan(long timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = Optional.ofNullable(timespan); + return this; + } + + /** + * The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + */ + public Builder timespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + public GetBandwidthStatisticsRequest build() { + return new GetBandwidthStatisticsRequest( + timespan); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsRequestBuilder.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsRequestBuilder.java new file mode 100644 index 00000000..8d2e7608 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import lukehagar.plexapi.plexapi.models.errors.SDKError; +import lukehagar.plexapi.plexapi.utils.LazySingletonValue; +import lukehagar.plexapi.plexapi.utils.Utils; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetBandwidthStatisticsRequestBuilder { + + private Optional timespan = Optional.empty(); + private final SDKMethodInterfaces.MethodCallGetBandwidthStatistics sdk; + + public GetBandwidthStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetBandwidthStatistics sdk) { + this.sdk = sdk; + } + + 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; + } + + public GetBandwidthStatisticsResponse call() throws Exception { + + return sdk.getBandwidthStatistics( + timespan); + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsResponse.java new file mode 100644 index 00000000..e5a09de0 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetBandwidthStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * 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 final 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 + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * 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/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsResponseBody.java new file mode 100644 index 00000000..b73b1a2f --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetBandwidthStatisticsResponseBody.java @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; +/** + * GetBandwidthStatisticsResponseBody - Bandwidth Statistics + */ + +public class GetBandwidthStatisticsResponseBody { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("MediaContainer") + private Optional mediaContainer; + + @JsonCreator + public GetBandwidthStatisticsResponseBody( + @JsonProperty("MediaContainer") Optional mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = mediaContainer; + } + + public GetBandwidthStatisticsResponseBody() { + this(Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetBandwidthStatisticsResponseBody withMediaContainer(GetBandwidthStatisticsMediaContainer mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = Optional.ofNullable(mediaContainer); + return this; + } + + public GetBandwidthStatisticsResponseBody withMediaContainer(Optional mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = mediaContainer; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBandwidthStatisticsResponseBody other = (GetBandwidthStatisticsResponseBody) o; + return + java.util.Objects.deepEquals(this.mediaContainer, other.mediaContainer); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + mediaContainer); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsResponseBody.class, + "mediaContainer", mediaContainer); + } + + public final static class Builder { + + private Optional mediaContainer = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder mediaContainer(GetBandwidthStatisticsMediaContainer mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = Optional.ofNullable(mediaContainer); + return this; + } + + public Builder mediaContainer(Optional mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = mediaContainer; + return this; + } + + public GetBandwidthStatisticsResponseBody build() { + return new GetBandwidthStatisticsResponseBody( + mediaContainer); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksButlerResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksButlerResponseBody.java deleted file mode 100644 index 6ad86a3d..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksButlerResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetButlerTasksButlerResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetButlerTasksButlerResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetButlerTasksButlerResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetButlerTasksButlerResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetButlerTasksButlerResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetButlerTasksButlerResponseBody other = (GetButlerTasksButlerResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetButlerTasksButlerResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetButlerTasksButlerResponseBody build() { - return new GetButlerTasksButlerResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksResponse.java index 14f4f3cf..d7be4b47 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R /** * All butler tasks */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetButlerTasksResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R /** * All butler tasks */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R /** * All butler tasks */ - public GetButlerTasksResponse withTwoHundredApplicationJsonObject(GetButlerTasksResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetButlerTasksResponse withObject(GetButlerTasksResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * All butler tasks */ - public GetButlerTasksResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetButlerTasksResponse withFourHundredAndOneApplicationJsonObject(GetButlerTasksButlerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetButlerTasksResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetButlerTasksResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R /** * All butler tasks */ - public Builder twoHundredApplicationJsonObject(GetButlerTasksResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetButlerTasksResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * All butler tasks */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetButlerTasksButlerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetButlerTasksResponse implements lukehagar.plexapi.plexapi.utils.R contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksResponseBody.java index 2340f712..43a4b19f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetButlerTasksResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetButlerTasksResponseBody - All butler tasks */ @@ -26,14 +27,21 @@ public class GetButlerTasksResponseBody { @JsonProperty("ButlerTasks") private Optional butlerTasks; + @JsonCreator public GetButlerTasksResponseBody( @JsonProperty("ButlerTasks") Optional butlerTasks) { Utils.checkNotNull(butlerTasks, "butlerTasks"); this.butlerTasks = butlerTasks; } + + public GetButlerTasksResponseBody() { + this(Optional.empty()); + } - public Optional butlerTasks() { - return butlerTasks; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional butlerTasks() { + return (Optional) butlerTasks; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesMediaContainer.java index aa00b98b..dbbfeb75 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetDevicesMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetDevicesMediaContainer { @JsonProperty("Device") private Optional> device; + @JsonCreator public GetDevicesMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("identifier") Optional identifier, @@ -42,17 +44,27 @@ public class GetDevicesMediaContainer { this.identifier = identifier; this.device = device; } - - public Optional size() { - return size; + + public GetDevicesMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional> device() { - return device; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> device() { + return (Optional>) device; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesResponse.java index 02f3ae90..7d593daa 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * Devices */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetDevicesResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * Devices */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * Devices */ - public GetDevicesResponse withTwoHundredApplicationJsonObject(GetDevicesResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetDevicesResponse withObject(GetDevicesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Devices */ - public GetDevicesResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetDevicesResponse withFourHundredAndOneApplicationJsonObject(GetDevicesServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetDevicesResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetDevicesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * Devices */ - public Builder twoHundredApplicationJsonObject(GetDevicesResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetDevicesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Devices */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetDevicesServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetDevicesResponse implements lukehagar.plexapi.plexapi.utils.Respo contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesResponseBody.java index f8e4d315..c5d1f9bc 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetDevicesResponseBody - Devices */ @@ -26,14 +27,21 @@ public class GetDevicesResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetDevicesResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetDevicesResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesServerResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesServerResponseBody.java deleted file mode 100644 index 4bc837da..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetDevicesServerResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetDevicesServerResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetDevicesServerResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetDevicesServerResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetDevicesServerResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetDevicesServerResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetDevicesServerResponseBody other = (GetDevicesServerResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetDevicesServerResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetDevicesServerResponseBody build() { - return new GetDevicesServerResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashRequest.java index 9c8fb58c..9d73d246 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetFileHashRequest { /** @@ -29,6 +30,7 @@ public class GetFileHashRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=type") private Optional type; + @JsonCreator public GetFileHashRequest( String url, Optional type) { @@ -37,10 +39,16 @@ public class GetFileHashRequest { this.url = url; this.type = type; } + + public GetFileHashRequest( + String url) { + this(url, Optional.empty()); + } /** * This is the path to the local file, must be prefixed by `file://` */ + @JsonIgnore public String url() { return url; } @@ -48,8 +56,10 @@ public class GetFileHashRequest { /** * Item type */ - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashResponse.java index 76b3b7a9..1446279a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetFileHashResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetFileHashResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class GetFileHashResponse implements lukehagar.plexapi.plexapi.utils.Resp */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public GetFileHashResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class GetFileHashResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class GetFileHashResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class GetFileHashResponse implements lukehagar.plexapi.plexapi.utils.Resp this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetFileHashResponse withObject(GetFileHashResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetFileHashResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class GetFileHashResponse implements lukehagar.plexapi.plexapi.utils.Resp return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class GetFileHashResponse implements lukehagar.plexapi.plexapi.utils.Resp return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class GetFileHashResponse implements lukehagar.plexapi.plexapi.utils.Resp return Utils.toString(GetFileHashResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class GetFileHashResponse implements lukehagar.plexapi.plexapi.utils.Resp private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class GetFileHashResponse implements lukehagar.plexapi.plexapi.utils.Resp this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(GetFileHashResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public GetFileHashResponse build() { return new GetFileHashResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsHubsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsHubsResponseBody.java deleted file mode 100644 index a8b4d7a7..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsHubsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetGlobalHubsHubsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetGlobalHubsHubsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetGlobalHubsHubsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetGlobalHubsHubsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetGlobalHubsHubsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetGlobalHubsHubsResponseBody other = (GetGlobalHubsHubsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetGlobalHubsHubsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetGlobalHubsHubsResponseBody build() { - return new GetGlobalHubsHubsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsMediaContainer.java index 4517b693..b88f5120 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetGlobalHubsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -35,6 +36,7 @@ public class GetGlobalHubsMediaContainer { @JsonProperty("Hub") private Optional> hub; + @JsonCreator public GetGlobalHubsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowSync") Optional allowSync, @@ -49,21 +51,33 @@ public class GetGlobalHubsMediaContainer { this.identifier = identifier; this.hub = hub; } - - public Optional size() { - return size; + + public GetGlobalHubsMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional> hub() { - return hub; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> hub() { + return (Optional>) hub; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsMetadata.java index 6eaeb04f..dc56d3c3 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetGlobalHubsMetadata { @JsonInclude(Include.NON_ABSENT) @@ -87,6 +88,7 @@ public class GetGlobalHubsMetadata { @JsonProperty("updatedAt") private Optional updatedAt; + @JsonCreator public GetGlobalHubsMetadata( @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("key") Optional key, @@ -140,73 +142,111 @@ public class GetGlobalHubsMetadata { this.addedAt = addedAt; this.updatedAt = updatedAt; } - - public Optional ratingKey() { - return ratingKey; + + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional titleSort() { - return titleSort; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional titleSort() { + return (Optional) titleSort; } - public Optional smart() { - return smart; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional playlistType() { - return playlistType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional smart() { + return (Optional) smart; } - public Optional composite() { - return composite; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional playlistType() { + return (Optional) playlistType; } - public Optional icon() { - return icon; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional composite() { + return (Optional) composite; } - public Optional viewCount() { - return viewCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional icon() { + return (Optional) icon; } - public Optional lastViewedAt() { - return lastViewedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewCount() { + return (Optional) viewCount; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastViewedAt() { + return (Optional) lastViewedAt; } - public Optional leafCount() { - return leafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsRequest.java index 4aef8574..2a7328f2 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetGlobalHubsRequest { /** @@ -29,6 +30,7 @@ public class GetGlobalHubsRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=onlyTransient") private Optional onlyTransient; + @JsonCreator public GetGlobalHubsRequest( Optional count, Optional onlyTransient) { @@ -37,19 +39,27 @@ public class GetGlobalHubsRequest { this.count = count; this.onlyTransient = onlyTransient; } + + public GetGlobalHubsRequest() { + this(Optional.empty(), Optional.empty()); + } /** * The number of items to return with each hub. */ - public Optional count() { - return count; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional count() { + return (Optional) count; } /** * 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). */ - public Optional onlyTransient() { - return onlyTransient; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional onlyTransient() { + return (Optional) onlyTransient; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsResponse.java index 6bd21704..12407ec6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * returns global hubs */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetGlobalHubsResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * returns global hubs */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * returns global hubs */ - public GetGlobalHubsResponse withTwoHundredApplicationJsonObject(GetGlobalHubsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetGlobalHubsResponse withObject(GetGlobalHubsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * returns global hubs */ - public GetGlobalHubsResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetGlobalHubsResponse withFourHundredAndOneApplicationJsonObject(GetGlobalHubsHubsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetGlobalHubsResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetGlobalHubsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * returns global hubs */ - public Builder twoHundredApplicationJsonObject(GetGlobalHubsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetGlobalHubsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * returns global hubs */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetGlobalHubsHubsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetGlobalHubsResponse implements lukehagar.plexapi.plexapi.utils.Re contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsResponseBody.java index 9d7d6cf4..2c79f4b2 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetGlobalHubsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetGlobalHubsResponseBody - returns global hubs */ @@ -26,14 +27,21 @@ public class GetGlobalHubsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetGlobalHubsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetGlobalHubsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataRequestBuilder.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataRequestBuilder.java new file mode 100644 index 00000000..682ce0aa --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import lukehagar.plexapi.plexapi.models.errors.SDKError; +import lukehagar.plexapi.plexapi.utils.LazySingletonValue; +import lukehagar.plexapi.plexapi.utils.Utils; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetHomeDataRequestBuilder { + + private final SDKMethodInterfaces.MethodCallGetHomeData sdk; + + public GetHomeDataRequestBuilder(SDKMethodInterfaces.MethodCallGetHomeData sdk) { + this.sdk = sdk; + } + + public GetHomeDataResponse call() throws Exception { + + return sdk.getHomeDataDirect(); + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataResponse.java new file mode 100644 index 00000000..73e54742 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetHomeDataResponse implements lukehagar.plexapi.plexapi.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * 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 final 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 + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetHomeDataResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * 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/lukehagar/plexapi/plexapi/models/operations/GetHomeDataResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataResponseBody.java new file mode 100644 index 00000000..306bc3d3 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetHomeDataResponseBody.java @@ -0,0 +1,329 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; +/** + * GetHomeDataResponseBody - Home Data + */ + +public class GetHomeDataResponseBody { + + @JsonInclude(Include.NON_ABSENT) + @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; + + @JsonCreator + public GetHomeDataResponseBody( + @JsonProperty("id") Optional id, + @JsonProperty("name") Optional name, + @JsonProperty("guestUserID") Optional guestUserID, + @JsonProperty("guestUserUUID") Optional guestUserUUID, + @JsonProperty("guestEnabled") Optional guestEnabled, + @JsonProperty("subscription") Optional subscription) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(guestUserID, "guestUserID"); + Utils.checkNotNull(guestUserUUID, "guestUserUUID"); + Utils.checkNotNull(guestEnabled, "guestEnabled"); + Utils.checkNotNull(subscription, "subscription"); + this.id = id; + this.name = name; + this.guestUserID = guestUserID; + this.guestUserUUID = guestUserUUID; + this.guestEnabled = guestEnabled; + this.subscription = subscription; + } + + public GetHomeDataResponseBody() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guestUserID() { + return (Optional) guestUserID; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guestUserUUID() { + return (Optional) guestUserUUID; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guestEnabled() { + return (Optional) guestEnabled; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subscription() { + return (Optional) subscription; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetHomeDataResponseBody withId(double id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public GetHomeDataResponseBody withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetHomeDataResponseBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + public GetHomeDataResponseBody withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public GetHomeDataResponseBody withGuestUserID(double guestUserID) { + Utils.checkNotNull(guestUserID, "guestUserID"); + this.guestUserID = Optional.ofNullable(guestUserID); + return this; + } + + public GetHomeDataResponseBody withGuestUserID(Optional guestUserID) { + Utils.checkNotNull(guestUserID, "guestUserID"); + this.guestUserID = guestUserID; + return this; + } + + public GetHomeDataResponseBody withGuestUserUUID(String guestUserUUID) { + Utils.checkNotNull(guestUserUUID, "guestUserUUID"); + this.guestUserUUID = Optional.ofNullable(guestUserUUID); + return this; + } + + public GetHomeDataResponseBody withGuestUserUUID(Optional guestUserUUID) { + Utils.checkNotNull(guestUserUUID, "guestUserUUID"); + this.guestUserUUID = guestUserUUID; + return this; + } + + public GetHomeDataResponseBody withGuestEnabled(boolean guestEnabled) { + Utils.checkNotNull(guestEnabled, "guestEnabled"); + this.guestEnabled = Optional.ofNullable(guestEnabled); + return this; + } + + public GetHomeDataResponseBody withGuestEnabled(Optional guestEnabled) { + Utils.checkNotNull(guestEnabled, "guestEnabled"); + this.guestEnabled = guestEnabled; + return this; + } + + public GetHomeDataResponseBody withSubscription(boolean subscription) { + Utils.checkNotNull(subscription, "subscription"); + this.subscription = Optional.ofNullable(subscription); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetHomeDataResponseBody other = (GetHomeDataResponseBody) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.guestUserID, other.guestUserID) && + java.util.Objects.deepEquals(this.guestUserUUID, other.guestUserUUID) && + java.util.Objects.deepEquals(this.guestEnabled, other.guestEnabled) && + java.util.Objects.deepEquals(this.subscription, other.subscription); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name, + guestUserID, + guestUserUUID, + guestEnabled, + subscription); + } + + @Override + public String toString() { + return Utils.toString(GetHomeDataResponseBody.class, + "id", id, + "name", name, + "guestUserID", guestUserID, + "guestUserUUID", guestUserUUID, + "guestEnabled", guestEnabled, + "subscription", subscription); + } + + 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); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder guestUserID(double guestUserID) { + Utils.checkNotNull(guestUserID, "guestUserID"); + this.guestUserID = Optional.ofNullable(guestUserID); + return this; + } + + public Builder guestUserID(Optional guestUserID) { + Utils.checkNotNull(guestUserID, "guestUserID"); + this.guestUserID = guestUserID; + return this; + } + + public Builder guestUserUUID(String guestUserUUID) { + Utils.checkNotNull(guestUserUUID, "guestUserUUID"); + this.guestUserUUID = Optional.ofNullable(guestUserUUID); + return this; + } + + public Builder guestUserUUID(Optional guestUserUUID) { + Utils.checkNotNull(guestUserUUID, "guestUserUUID"); + this.guestUserUUID = guestUserUUID; + return this; + } + + public Builder guestEnabled(boolean guestEnabled) { + Utils.checkNotNull(guestEnabled, "guestEnabled"); + this.guestEnabled = Optional.ofNullable(guestEnabled); + return this; + } + + public Builder guestEnabled(Optional guestEnabled) { + Utils.checkNotNull(guestEnabled, "guestEnabled"); + this.guestEnabled = guestEnabled; + return this; + } + + public Builder subscription(boolean subscription) { + Utils.checkNotNull(subscription, "subscription"); + this.subscription = Optional.ofNullable(subscription); + return this; + } + + public Builder subscription(Optional subscription) { + Utils.checkNotNull(subscription, "subscription"); + this.subscription = subscription; + return this; + } + + public GetHomeDataResponseBody build() { + return new GetHomeDataResponseBody( + id, + name, + guestUserID, + guestUserUUID, + guestEnabled, + subscription); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesDirectory.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesDirectory.java index ba41c659..c1ceb26a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesDirectory.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesDirectory.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibrariesDirectory { @JsonInclude(Include.NON_ABSENT) @@ -103,6 +104,7 @@ public class GetLibrariesDirectory { @JsonProperty("Location") private Optional> location; + @JsonCreator public GetLibrariesDirectory( @JsonProperty("allowSync") Optional allowSync, @JsonProperty("art") Optional art, @@ -168,89 +170,135 @@ public class GetLibrariesDirectory { this.hidden = hidden; this.location = location; } - - public Optional allowSync() { - return allowSync; + + public GetLibrariesDirectory() { + 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()); } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional composite() { - return composite; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional filters() { - return filters; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional composite() { + return (Optional) composite; } - public Optional refreshing() { - return refreshing; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filters() { + return (Optional) filters; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional refreshing() { + return (Optional) refreshing; } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional agent() { - return agent; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional scanner() { - return scanner; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional agent() { + return (Optional) agent; } - public Optional language() { - return language; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional scanner() { + return (Optional) scanner; } - public Optional uuid() { - return uuid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional language() { + return (Optional) language; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional uuid() { + return (Optional) uuid; } - public Optional createdAt() { - return createdAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional scannedAt() { - return scannedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; } - public Optional content() { - return content; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional scannedAt() { + return (Optional) scannedAt; } - public Optional directory() { - return directory; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional content() { + return (Optional) content; } - public Optional contentChangedAt() { - return contentChangedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional directory() { + return (Optional) directory; } - public Optional hidden() { - return hidden; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional contentChangedAt() { + return (Optional) contentChangedAt; } - public Optional> location() { - return location; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hidden() { + return (Optional) hidden; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> location() { + return (Optional>) location; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesLibraryResponseBody.java deleted file mode 100644 index e466a157..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesLibraryResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetLibrariesLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetLibrariesLibraryResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetLibrariesLibraryResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetLibrariesLibraryResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetLibrariesLibraryResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetLibrariesLibraryResponseBody other = (GetLibrariesLibraryResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetLibrariesLibraryResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetLibrariesLibraryResponseBody build() { - return new GetLibrariesLibraryResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesLocation.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesLocation.java index 8e9422ef..0d892811 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesLocation.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesLocation.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibrariesLocation { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class GetLibrariesLocation { @JsonProperty("path") private Optional path; + @JsonCreator public GetLibrariesLocation( @JsonProperty("id") Optional id, @JsonProperty("path") Optional path) { @@ -35,13 +37,21 @@ public class GetLibrariesLocation { this.id = id; this.path = path; } - - public Optional id() { - return id; + + public GetLibrariesLocation() { + this(Optional.empty(), Optional.empty()); } - public Optional path() { - return path; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional path() { + return (Optional) path; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesMediaContainer.java index 557a8696..99a627da 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibrariesMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -35,6 +36,7 @@ public class GetLibrariesMediaContainer { @JsonProperty("Directory") private Optional> directory; + @JsonCreator public GetLibrariesMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowSync") Optional allowSync, @@ -49,21 +51,33 @@ public class GetLibrariesMediaContainer { this.title1 = title1; this.directory = directory; } - - public Optional size() { - return size; + + public GetLibrariesMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional title1() { - return title1; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional> directory() { - return directory; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title1() { + return (Optional) title1; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> directory() { + return (Optional>) directory; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesResponse.java index 068654d7..74c339ec 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res /** * The libraries available on the Server */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetLibrariesResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + this.object = object; + } + + public GetLibrariesResponse( + 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; } @@ -70,6 +72,7 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res /** * The libraries available on the Server */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res /** * The libraries available on the Server */ - public GetLibrariesResponse withTwoHundredApplicationJsonObject(GetLibrariesResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetLibrariesResponse withObject(GetLibrariesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The libraries available on the Server */ - public GetLibrariesResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetLibrariesResponse withFourHundredAndOneApplicationJsonObject(GetLibrariesLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetLibrariesResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetLibrariesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res /** * The libraries available on the Server */ - public Builder twoHundredApplicationJsonObject(GetLibrariesResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetLibrariesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The libraries available on the Server */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetLibrariesLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetLibrariesResponse implements lukehagar.plexapi.plexapi.utils.Res contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesResponseBody.java index 6e582a1e..bb6baf22 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibrariesResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetLibrariesResponseBody - The libraries available on the Server */ @@ -26,14 +27,21 @@ public class GetLibrariesResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetLibrariesResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetLibrariesResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryDirectory.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryDirectory.java index 282d4916..9bb0d734 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryDirectory.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryDirectory.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryDirectory { @JsonInclude(Include.NON_ABSENT) @@ -39,6 +40,7 @@ public class GetLibraryDirectory { @JsonProperty("search") private Optional search; + @JsonCreator public GetLibraryDirectory( @JsonProperty("key") Optional key, @JsonProperty("title") Optional title, @@ -56,25 +58,39 @@ public class GetLibraryDirectory { this.prompt = prompt; this.search = search; } - - public Optional key() { - return key; + + public GetLibraryDirectory() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional secondary() { - return secondary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional prompt() { - return prompt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional secondary() { + return (Optional) secondary; } - public Optional search() { - return search; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional prompt() { + return (Optional) prompt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional search() { + return (Optional) search; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryFilter.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryFilter.java new file mode 100644 index 00000000..2ba9e778 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryFilter.java @@ -0,0 +1,283 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetLibraryFilter { + + @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; + + @JsonCreator + public GetLibraryFilter( + @JsonProperty("filter") Optional filter, + @JsonProperty("filterType") Optional filterType, + @JsonProperty("key") Optional key, + @JsonProperty("title") Optional title, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(filter, "filter"); + Utils.checkNotNull(filterType, "filterType"); + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(title, "title"); + Utils.checkNotNull(type, "type"); + this.filter = filter; + this.filterType = filterType; + this.key = key; + this.title = title; + this.type = type; + } + + public GetLibraryFilter() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filterType() { + return (Optional) filterType; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryFilter withFilter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + public GetLibraryFilter withFilter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public GetLibraryFilter withFilterType(String filterType) { + Utils.checkNotNull(filterType, "filterType"); + this.filterType = Optional.ofNullable(filterType); + return this; + } + + public GetLibraryFilter withFilterType(Optional filterType) { + Utils.checkNotNull(filterType, "filterType"); + this.filterType = filterType; + return this; + } + + public GetLibraryFilter withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = Optional.ofNullable(key); + return this; + } + + public GetLibraryFilter withKey(Optional key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetLibraryFilter withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.ofNullable(title); + return this; + } + + public GetLibraryFilter withTitle(Optional title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public GetLibraryFilter withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + public GetLibraryFilter withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryFilter other = (GetLibraryFilter) o; + return + java.util.Objects.deepEquals(this.filter, other.filter) && + java.util.Objects.deepEquals(this.filterType, other.filterType) && + java.util.Objects.deepEquals(this.key, other.key) && + java.util.Objects.deepEquals(this.title, other.title) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + filter, + filterType, + key, + title, + type); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryFilter.class, + "filter", filter, + "filterType", filterType, + "key", key, + "title", title, + "type", type); + } + + 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); + return this; + } + + public Builder filter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public Builder filterType(String filterType) { + Utils.checkNotNull(filterType, "filterType"); + this.filterType = Optional.ofNullable(filterType); + return this; + } + + public Builder filterType(Optional filterType) { + Utils.checkNotNull(filterType, "filterType"); + this.filterType = filterType; + return this; + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = Optional.ofNullable(key); + return this; + } + + public Builder key(Optional key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.ofNullable(title); + return this; + } + + public Builder title(Optional title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetLibraryFilter build() { + return new GetLibraryFilter( + filter, + filterType, + key, + title, + type); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsCountry.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsCountry.java index f2719eaa..3596b570 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsCountry.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsCountry.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsCountry { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetLibraryHubsCountry( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetLibraryHubsCountry() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsDirector.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsDirector.java index 87a58dd1..7f4b3e57 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsDirector.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsDirector.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsDirector { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetLibraryHubsDirector( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetLibraryHubsDirector() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsGenre.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsGenre.java index 9d3952b0..12177dbf 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsGenre.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsGenre.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsGenre { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetLibraryHubsGenre( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetLibraryHubsGenre() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsHub.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsHub.java index d2e97f53..b4b0e6dc 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsHub.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsHub.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsHub { @JsonInclude(Include.NON_ABSENT) @@ -67,6 +68,7 @@ public class GetLibraryHubsHub { @JsonProperty("random") private Optional random; + @JsonCreator public GetLibraryHubsHub( @JsonProperty("key") Optional key, @JsonProperty("title") Optional title, @@ -105,53 +107,81 @@ public class GetLibraryHubsHub { this.promoted = promoted; this.random = random; } - - public Optional key() { - return key; + + 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()); } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional hubIdentifier() { - return hubIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional context() { - return context; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hubIdentifier() { + return (Optional) hubIdentifier; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional context() { + return (Optional) context; } - public Optional more() { - return more; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional style() { - return style; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional more() { + return (Optional) more; } - public Optional hubKey() { - return hubKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional style() { + return (Optional) style; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hubKey() { + return (Optional) hubKey; } - public Optional promoted() { - return promoted; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } - public Optional random() { - return random; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional promoted() { + return (Optional) promoted; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional random() { + return (Optional) random; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsHubsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsHubsResponseBody.java deleted file mode 100644 index 61d6e425..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsHubsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetLibraryHubsHubsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetLibraryHubsHubsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetLibraryHubsHubsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetLibraryHubsHubsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetLibraryHubsHubsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetLibraryHubsHubsResponseBody other = (GetLibraryHubsHubsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetLibraryHubsHubsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetLibraryHubsHubsResponseBody build() { - return new GetLibraryHubsHubsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMedia.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMedia.java index 0fec632e..275735e5 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMedia.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMedia.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsMedia { @JsonInclude(Include.NON_ABSENT) @@ -87,6 +88,7 @@ public class GetLibraryHubsMedia { @JsonProperty("Part") private Optional> part; + @JsonCreator public GetLibraryHubsMedia( @JsonProperty("id") Optional id, @JsonProperty("duration") Optional duration, @@ -140,73 +142,111 @@ public class GetLibraryHubsMedia { this.videoProfile = videoProfile; this.part = part; } - - public Optional id() { - return id; + + 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()); } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional width() { - return width; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional height() { - return height; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional width() { + return (Optional) width; } - public Optional aspectRatio() { - return aspectRatio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional height() { + return (Optional) height; } - public Optional audioChannels() { - return audioChannels; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional aspectRatio() { + return (Optional) aspectRatio; } - public Optional audioCodec() { - return audioCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioChannels() { + return (Optional) audioChannels; } - public Optional videoCodec() { - return videoCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioCodec() { + return (Optional) audioCodec; } - public Optional videoResolution() { - return videoResolution; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoCodec() { + return (Optional) videoCodec; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoResolution() { + return (Optional) videoResolution; } - public Optional videoFrameRate() { - return videoFrameRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional optimizedForStreaming() { - return optimizedForStreaming; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoFrameRate() { + return (Optional) videoFrameRate; } - public Optional audioProfile() { - return audioProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional optimizedForStreaming() { + return (Optional) optimizedForStreaming; } - public Optional has64bitOffsets() { - return has64bitOffsets; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioProfile() { + return (Optional) audioProfile; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional has64bitOffsets() { + return (Optional) has64bitOffsets; } - public Optional> part() { - return part; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> part() { + return (Optional>) part; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMediaContainer.java index 6f41111b..066c4fa0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -47,6 +48,7 @@ public class GetLibraryHubsMediaContainer { @JsonProperty("Hub") private Optional> hub; + @JsonCreator public GetLibraryHubsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowSync") Optional allowSync, @@ -70,33 +72,51 @@ public class GetLibraryHubsMediaContainer { this.librarySectionUUID = librarySectionUUID; this.hub = hub; } - - public Optional size() { - return size; + + public GetLibraryHubsMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional librarySectionUUID() { - return librarySectionUUID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; } - public Optional> hub() { - return hub; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionUUID() { + return (Optional) librarySectionUUID; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> hub() { + return (Optional>) hub; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMetadata.java index 6465b78e..34d1f030 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -17,7 +19,6 @@ import java.time.LocalDate; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsMetadata { @JsonInclude(Include.NON_ABSENT) @@ -156,6 +157,7 @@ public class GetLibraryHubsMetadata { @JsonProperty("chapterSource") private Optional chapterSource; + @JsonCreator public GetLibraryHubsMetadata( @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("key") Optional key, @@ -260,141 +262,213 @@ public class GetLibraryHubsMetadata { this.skipCount = skipCount; this.chapterSource = chapterSource; } - - public Optional ratingKey() { - return ratingKey; + + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional studio() { - return studio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional studio() { + return (Optional) studio; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; } - public Optional librarySectionKey() { - return librarySectionKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional contentRating() { - return contentRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionKey() { + return (Optional) librarySectionKey; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional contentRating() { + return (Optional) contentRating; } - public Optional rating() { - return rating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional audienceRating() { - return audienceRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional rating() { + return (Optional) rating; } - public Optional viewCount() { - return viewCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRating() { + return (Optional) audienceRating; } - public Optional lastViewedAt() { - return lastViewedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewCount() { + return (Optional) viewCount; } - public Optional year() { - return year; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastViewedAt() { + return (Optional) lastViewedAt; } - public Optional tagline() { - return tagline; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional year() { + return (Optional) year; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagline() { + return (Optional) tagline; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional originallyAvailableAt() { - return originallyAvailableAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originallyAvailableAt() { + return (Optional) originallyAvailableAt; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; } - public Optional audienceRatingImage() { - return audienceRatingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional primaryExtraKey() { - return primaryExtraKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRatingImage() { + return (Optional) audienceRatingImage; } - public Optional ratingImage() { - return ratingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional primaryExtraKey() { + return (Optional) primaryExtraKey; } - public Optional> media() { - return media; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingImage() { + return (Optional) ratingImage; } - public Optional> genre() { - return genre; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> media() { + return (Optional>) media; } - public Optional> country() { - return country; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> genre() { + return (Optional>) genre; } - public Optional> director() { - return director; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> country() { + return (Optional>) country; } - public Optional> role() { - return role; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> director() { + return (Optional>) director; } - public Optional> writer() { - return writer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> role() { + return (Optional>) role; } - public Optional skipCount() { - return skipCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> writer() { + return (Optional>) writer; } - public Optional chapterSource() { - return chapterSource; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional skipCount() { + return (Optional) skipCount; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional chapterSource() { + return (Optional) chapterSource; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsPart.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsPart.java index 923b9423..764ee443 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsPart.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsPart.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsPart { @JsonInclude(Include.NON_ABSENT) @@ -59,6 +60,7 @@ public class GetLibraryHubsPart { @JsonProperty("videoProfile") private Optional videoProfile; + @JsonCreator public GetLibraryHubsPart( @JsonProperty("id") Optional id, @JsonProperty("key") Optional key, @@ -91,45 +93,69 @@ public class GetLibraryHubsPart { this.optimizedForStreaming = optimizedForStreaming; this.videoProfile = videoProfile; } - - public Optional id() { - return id; + + public GetLibraryHubsPart() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional file() { - return file; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional file() { + return (Optional) file; } - public Optional audioProfile() { - return audioProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioProfile() { + return (Optional) audioProfile; } - public Optional has64bitOffsets() { - return has64bitOffsets; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional optimizedForStreaming() { - return optimizedForStreaming; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional has64bitOffsets() { + return (Optional) has64bitOffsets; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional optimizedForStreaming() { + return (Optional) optimizedForStreaming; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsRequest.java index 3a0a2a0b..568efd05 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsRequest { /** @@ -35,6 +36,7 @@ public class GetLibraryHubsRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=onlyTransient") private Optional onlyTransient; + @JsonCreator public GetLibraryHubsRequest( double sectionId, Optional count, @@ -46,10 +48,16 @@ public class GetLibraryHubsRequest { this.count = count; this.onlyTransient = onlyTransient; } + + public GetLibraryHubsRequest( + double sectionId) { + this(sectionId, Optional.empty(), Optional.empty()); + } /** * the Id of the library to query */ + @JsonIgnore public double sectionId() { return sectionId; } @@ -57,15 +65,19 @@ public class GetLibraryHubsRequest { /** * The number of items to return with each hub. */ - public Optional count() { - return count; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional count() { + return (Optional) count; } /** * 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). */ - public Optional onlyTransient() { - return onlyTransient; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional onlyTransient() { + return (Optional) onlyTransient; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsResponse.java index 991559e9..00b4a484 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R /** * The hubs specific to the library */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetLibraryHubsResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R /** * The hubs specific to the library */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R /** * The hubs specific to the library */ - public GetLibraryHubsResponse withTwoHundredApplicationJsonObject(GetLibraryHubsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetLibraryHubsResponse withObject(GetLibraryHubsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The hubs specific to the library */ - public GetLibraryHubsResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetLibraryHubsResponse withFourHundredAndOneApplicationJsonObject(GetLibraryHubsHubsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetLibraryHubsResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetLibraryHubsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R /** * The hubs specific to the library */ - public Builder twoHundredApplicationJsonObject(GetLibraryHubsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetLibraryHubsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The hubs specific to the library */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetLibraryHubsHubsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetLibraryHubsResponse implements lukehagar.plexapi.plexapi.utils.R contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsResponseBody.java index a92803bb..59bdcafa 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetLibraryHubsResponseBody - The hubs specific to the library */ @@ -26,14 +27,21 @@ public class GetLibraryHubsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetLibraryHubsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetLibraryHubsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsRole.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsRole.java index 1b421e98..02eecf73 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsRole.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsRole.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsRole { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetLibraryHubsRole( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetLibraryHubsRole() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsWriter.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsWriter.java index 6ac5b76b..2ed2f3c6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsWriter.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryHubsWriter.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryHubsWriter { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetLibraryHubsWriter( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetLibraryHubsWriter() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsCountry.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsCountry.java index b77a83a8..3c5e0603 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsCountry.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsCountry.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsCountry { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetLibraryItemsCountry( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetLibraryItemsCountry() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsDirector.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsDirector.java index cef998a6..9fb8c0a9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsDirector.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsDirector.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsDirector { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetLibraryItemsDirector( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetLibraryItemsDirector() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsGenre.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsGenre.java index 416f77ae..556135e4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsGenre.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsGenre.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsGenre { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetLibraryItemsGenre( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetLibraryItemsGenre() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMedia.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMedia.java index bc04ef33..edb8299a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMedia.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMedia.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsMedia { @JsonInclude(Include.NON_ABSENT) @@ -75,6 +76,7 @@ public class GetLibraryItemsMedia { @JsonProperty("Part") private Optional> part; + @JsonCreator public GetLibraryItemsMedia( @JsonProperty("id") Optional id, @JsonProperty("duration") Optional duration, @@ -119,61 +121,93 @@ public class GetLibraryItemsMedia { this.videoProfile = videoProfile; this.part = part; } - - public Optional id() { - return id; + + public GetLibraryItemsMedia() { + 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()); } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional width() { - return width; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional height() { - return height; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional width() { + return (Optional) width; } - public Optional aspectRatio() { - return aspectRatio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional height() { + return (Optional) height; } - public Optional audioChannels() { - return audioChannels; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional aspectRatio() { + return (Optional) aspectRatio; } - public Optional audioCodec() { - return audioCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioChannels() { + return (Optional) audioChannels; } - public Optional videoCodec() { - return videoCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioCodec() { + return (Optional) audioCodec; } - public Optional videoResolution() { - return videoResolution; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoCodec() { + return (Optional) videoCodec; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoResolution() { + return (Optional) videoResolution; } - public Optional videoFrameRate() { - return videoFrameRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoFrameRate() { + return (Optional) videoFrameRate; } - public Optional> part() { - return part; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> part() { + return (Optional>) part; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMediaContainer.java index 24bf8a63..cb24c80a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -37,7 +38,7 @@ public class GetLibraryItemsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") - private Optional librarySectionID; + private Optional librarySectionID; @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") @@ -83,12 +84,13 @@ public class GetLibraryItemsMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public GetLibraryItemsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowSync") Optional allowSync, @JsonProperty("art") Optional art, @JsonProperty("identifier") Optional identifier, - @JsonProperty("librarySectionID") Optional librarySectionID, + @JsonProperty("librarySectionID") Optional librarySectionID, @JsonProperty("librarySectionTitle") Optional librarySectionTitle, @JsonProperty("librarySectionUUID") Optional librarySectionUUID, @JsonProperty("mediaTagPrefix") Optional mediaTagPrefix, @@ -133,69 +135,105 @@ public class GetLibraryItemsMediaContainer { this.mixedParents = mixedParents; this.metadata = metadata; } - - public Optional size() { - return size; + + public GetLibraryItemsMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional librarySectionUUID() { - return librarySectionUUID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; } - public Optional mediaTagPrefix() { - return mediaTagPrefix; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionUUID() { + return (Optional) librarySectionUUID; } - public Optional mediaTagVersion() { - return mediaTagVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagPrefix() { + return (Optional) mediaTagPrefix; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagVersion() { + return (Optional) mediaTagVersion; } - public Optional title1() { - return title1; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional title2() { - return title2; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title1() { + return (Optional) title1; } - public Optional viewGroup() { - return viewGroup; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title2() { + return (Optional) title2; } - public Optional viewMode() { - return viewMode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewGroup() { + return (Optional) viewGroup; } - public Optional mixedParents() { - return mixedParents; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewMode() { + return (Optional) viewMode; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mixedParents() { + return (Optional) mixedParents; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { @@ -250,13 +288,13 @@ public class GetLibraryItemsMediaContainer { return this; } - public GetLibraryItemsMediaContainer withLibrarySectionID(int librarySectionID) { + public GetLibraryItemsMediaContainer withLibrarySectionID(LibrarySectionID librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); return this; } - public GetLibraryItemsMediaContainer withLibrarySectionID(Optional librarySectionID) { + public GetLibraryItemsMediaContainer withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; return this; @@ -474,7 +512,7 @@ public class GetLibraryItemsMediaContainer { private Optional identifier = Optional.empty(); - private Optional librarySectionID = Optional.empty(); + private Optional librarySectionID = Optional.empty(); private Optional librarySectionTitle = Optional.empty(); @@ -550,13 +588,13 @@ public class GetLibraryItemsMediaContainer { return this; } - public Builder librarySectionID(int librarySectionID) { + public Builder librarySectionID(LibrarySectionID librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); return this; } - public Builder librarySectionID(Optional librarySectionID) { + public Builder librarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; return this; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMetadata.java index 56ce0657..f73c1dc1 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -17,7 +19,6 @@ import java.time.LocalDate; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsMetadata { @JsonInclude(Include.NON_ABSENT) @@ -248,6 +249,7 @@ public class GetLibraryItemsMetadata { @JsonProperty("parentTheme") private Optional parentTheme; + @JsonCreator public GetLibraryItemsMetadata( @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("key") Optional key, @@ -421,233 +423,351 @@ public class GetLibraryItemsMetadata { this.parentThumb = parentThumb; this.parentTheme = parentTheme; } - - public Optional ratingKey() { - return ratingKey; + + public GetLibraryItemsMetadata() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional studio() { - return studio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional studio() { + return (Optional) studio; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional contentRating() { - return contentRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional contentRating() { + return (Optional) contentRating; } - public Optional rating() { - return rating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional audienceRating() { - return audienceRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional rating() { + return (Optional) rating; } - public Optional year() { - return year; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRating() { + return (Optional) audienceRating; } - public Optional tagline() { - return tagline; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional year() { + return (Optional) year; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagline() { + return (Optional) tagline; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional originallyAvailableAt() { - return originallyAvailableAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originallyAvailableAt() { + return (Optional) originallyAvailableAt; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; } - public Optional audienceRatingImage() { - return audienceRatingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional chapterSource() { - return chapterSource; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRatingImage() { + return (Optional) audienceRatingImage; } - public Optional primaryExtraKey() { - return primaryExtraKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional chapterSource() { + return (Optional) chapterSource; } - public Optional ratingImage() { - return ratingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional primaryExtraKey() { + return (Optional) primaryExtraKey; } - public Optional grandparentRatingKey() { - return grandparentRatingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingImage() { + return (Optional) ratingImage; } - public Optional grandparentGuid() { - return grandparentGuid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentRatingKey() { + return (Optional) grandparentRatingKey; } - public Optional grandparentKey() { - return grandparentKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentGuid() { + return (Optional) grandparentGuid; } - public Optional grandparentTitle() { - return grandparentTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentKey() { + return (Optional) grandparentKey; } - public Optional grandparentThumb() { - return grandparentThumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentTitle() { + return (Optional) grandparentTitle; } - public Optional grandparentArt() { - return grandparentArt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentThumb() { + return (Optional) grandparentThumb; } - public Optional grandparentTheme() { - return grandparentTheme; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentArt() { + return (Optional) grandparentArt; } - public Optional> media() { - return media; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentTheme() { + return (Optional) grandparentTheme; } - public Optional> genre() { - return genre; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> media() { + return (Optional>) media; } - public Optional> country() { - return country; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> genre() { + return (Optional>) genre; } - public Optional> director() { - return director; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> country() { + return (Optional>) country; } - public Optional> writer() { - return writer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> director() { + return (Optional>) director; } - public Optional> role() { - return role; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> writer() { + return (Optional>) writer; } - public Optional titleSort() { - return titleSort; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> role() { + return (Optional>) role; } - public Optional viewCount() { - return viewCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional titleSort() { + return (Optional) titleSort; } - public Optional lastViewedAt() { - return lastViewedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewCount() { + return (Optional) viewCount; } - public Optional originalTitle() { - return originalTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastViewedAt() { + return (Optional) lastViewedAt; } - public Optional viewOffset() { - return viewOffset; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originalTitle() { + return (Optional) originalTitle; } - public Optional skipCount() { - return skipCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewOffset() { + return (Optional) viewOffset; } - public Optional index() { - return index; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional skipCount() { + return (Optional) skipCount; } - public Optional theme() { - return theme; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional index() { + return (Optional) index; } - public Optional leafCount() { - return leafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional theme() { + return (Optional) theme; } - public Optional viewedLeafCount() { - return viewedLeafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; } - public Optional childCount() { - return childCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewedLeafCount() { + return (Optional) viewedLeafCount; } - public Optional hasPremiumExtras() { - return hasPremiumExtras; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional childCount() { + return (Optional) childCount; } - public Optional hasPremiumPrimaryExtra() { - return hasPremiumPrimaryExtra; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasPremiumExtras() { + return (Optional) hasPremiumExtras; } - public Optional parentRatingKey() { - return parentRatingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasPremiumPrimaryExtra() { + return (Optional) hasPremiumPrimaryExtra; } - public Optional parentGuid() { - return parentGuid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentRatingKey() { + return (Optional) parentRatingKey; } - public Optional parentStudio() { - return parentStudio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentGuid() { + return (Optional) parentGuid; } - public Optional parentKey() { - return parentKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentStudio() { + return (Optional) parentStudio; } - public Optional parentTitle() { - return parentTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentKey() { + return (Optional) parentKey; } - public Optional parentIndex() { - return parentIndex; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentTitle() { + return (Optional) parentTitle; } - public Optional parentYear() { - return parentYear; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentIndex() { + return (Optional) parentIndex; } - public Optional parentThumb() { - return parentThumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentYear() { + return (Optional) parentYear; } - public Optional parentTheme() { - return parentTheme; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentThumb() { + return (Optional) parentThumb; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentTheme() { + return (Optional) parentTheme; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsPart.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsPart.java index 8658a8f6..3030623f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsPart.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsPart.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsPart { @JsonInclude(Include.NON_ABSENT) @@ -47,6 +48,7 @@ public class GetLibraryItemsPart { @JsonProperty("videoProfile") private Optional videoProfile; + @JsonCreator public GetLibraryItemsPart( @JsonProperty("id") Optional id, @JsonProperty("key") Optional key, @@ -70,33 +72,51 @@ public class GetLibraryItemsPart { this.container = container; this.videoProfile = videoProfile; } - - public Optional id() { - return id; + + public GetLibraryItemsPart() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional file() { - return file; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional file() { + return (Optional) file; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRequest.java index bfa73377..ae3a0c00 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRequest.java @@ -4,23 +4,25 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsRequest { /** * the Id of the library to query */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionId") - private long sectionId; + private java.lang.Object sectionId; /** * A key representing a specific tag within the section. @@ -28,29 +30,58 @@ public class GetLibraryItemsRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tag") private Tag tag; + /** + * Adds the Guids object to the response + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids") + private Optional includeGuids; + + @JsonCreator public GetLibraryItemsRequest( - long sectionId, - Tag tag) { + java.lang.Object sectionId, + Tag tag, + Optional includeGuids) { Utils.checkNotNull(sectionId, "sectionId"); Utils.checkNotNull(tag, "tag"); + Utils.checkNotNull(includeGuids, "includeGuids"); this.sectionId = sectionId; this.tag = tag; + this.includeGuids = includeGuids; + } + + public GetLibraryItemsRequest( + java.lang.Object sectionId, + Tag tag) { + this(sectionId, tag, Optional.empty()); } /** * the Id of the library to query */ - public long sectionId() { + @JsonIgnore + public java.lang.Object sectionId() { return sectionId; } /** * A key representing a specific tag within the section. */ + @JsonIgnore public Tag tag() { return tag; } + /** + * Adds the Guids object to the response + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional includeGuids() { + return (Optional) includeGuids; + } + public final static Builder builder() { return new Builder(); } @@ -58,7 +89,7 @@ public class GetLibraryItemsRequest { /** * the Id of the library to query */ - public GetLibraryItemsRequest withSectionId(long sectionId) { + public GetLibraryItemsRequest withSectionId(java.lang.Object sectionId) { Utils.checkNotNull(sectionId, "sectionId"); this.sectionId = sectionId; return this; @@ -72,6 +103,26 @@ public class GetLibraryItemsRequest { this.tag = tag; return this; } + + /** + * Adds the Guids object to the response + * + */ + public GetLibraryItemsRequest withIncludeGuids(long includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = Optional.ofNullable(includeGuids); + return this; + } + + /** + * Adds the Guids object to the response + * + */ + public GetLibraryItemsRequest withIncludeGuids(Optional includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = includeGuids; + return this; + } @Override public boolean equals(java.lang.Object o) { @@ -84,28 +135,33 @@ public class GetLibraryItemsRequest { GetLibraryItemsRequest other = (GetLibraryItemsRequest) o; return java.util.Objects.deepEquals(this.sectionId, other.sectionId) && - java.util.Objects.deepEquals(this.tag, other.tag); + java.util.Objects.deepEquals(this.tag, other.tag) && + java.util.Objects.deepEquals(this.includeGuids, other.includeGuids); } @Override public int hashCode() { return java.util.Objects.hash( sectionId, - tag); + tag, + includeGuids); } @Override public String toString() { return Utils.toString(GetLibraryItemsRequest.class, "sectionId", sectionId, - "tag", tag); + "tag", tag, + "includeGuids", includeGuids); } public final static class Builder { - private Long sectionId; + private java.lang.Object sectionId; - private Tag tag; + private Tag tag; + + private Optional includeGuids = Optional.empty(); private Builder() { // force use of static builder() method @@ -114,7 +170,7 @@ public class GetLibraryItemsRequest { /** * the Id of the library to query */ - public Builder sectionId(long sectionId) { + public Builder sectionId(java.lang.Object sectionId) { Utils.checkNotNull(sectionId, "sectionId"); this.sectionId = sectionId; return this; @@ -128,11 +184,32 @@ public class GetLibraryItemsRequest { this.tag = tag; return this; } + + /** + * Adds the Guids object to the response + * + */ + public Builder includeGuids(long includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = Optional.ofNullable(includeGuids); + return this; + } + + /** + * Adds the Guids object to the response + * + */ + public Builder includeGuids(Optional includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = includeGuids; + return this; + } public GetLibraryItemsRequest build() { return new GetLibraryItemsRequest( sectionId, - tag); + tag, + includeGuids); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRequestBuilder.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRequestBuilder.java index 143cc536..d0d4df86 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRequestBuilder.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRequestBuilder.java @@ -19,15 +19,16 @@ import org.openapitools.jackson.nullable.JsonNullable; public class GetLibraryItemsRequestBuilder { - private Long sectionId; + private java.lang.Object sectionId; private Tag tag; + private Optional includeGuids = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetLibraryItems sdk; public GetLibraryItemsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryItems sdk) { this.sdk = sdk; } - public GetLibraryItemsRequestBuilder sectionId(long sectionId) { + public GetLibraryItemsRequestBuilder sectionId(java.lang.Object sectionId) { Utils.checkNotNull(sectionId, "sectionId"); this.sectionId = sectionId; return this; @@ -38,11 +39,24 @@ public class GetLibraryItemsRequestBuilder { this.tag = tag; return this; } + + public GetLibraryItemsRequestBuilder includeGuids(long includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = Optional.of(includeGuids); + return this; + } + + public GetLibraryItemsRequestBuilder includeGuids(Optional includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = includeGuids; + return this; + } public GetLibraryItemsResponse call() throws Exception { return sdk.getLibraryItems( sectionId, - tag); + tag, + includeGuids); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsResponse.java index af40b888..b02ae3d5 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -37,6 +38,7 @@ public class GetLibraryItemsResponse implements lukehagar.plexapi.plexapi.utils. */ private Optional object; + @JsonCreator public GetLibraryItemsResponse( String contentType, int statusCode, @@ -51,10 +53,18 @@ public class GetLibraryItemsResponse implements lukehagar.plexapi.plexapi.utils. 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; } @@ -62,6 +72,7 @@ public class GetLibraryItemsResponse implements lukehagar.plexapi.plexapi.utils. /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,6 +80,7 @@ public class GetLibraryItemsResponse implements lukehagar.plexapi.plexapi.utils. /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -76,8 +88,10 @@ public class GetLibraryItemsResponse implements lukehagar.plexapi.plexapi.utils. /** * The contents of the library by section and tag */ - public Optional object() { - return object; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsResponseBody.java index 933d37de..c71bfc4e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetLibraryItemsResponseBody - The contents of the library by section and tag */ @@ -26,14 +27,21 @@ public class GetLibraryItemsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetLibraryItemsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetLibraryItemsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRole.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRole.java index 48380412..0b4224e5 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRole.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsRole.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsRole { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetLibraryItemsRole( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetLibraryItemsRole() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsWriter.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsWriter.java index 3891d548..e1f15e62 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsWriter.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryItemsWriter.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryItemsWriter { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetLibraryItemsWriter( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetLibraryItemsWriter() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryLibraryResponseBody.java deleted file mode 100644 index 87105d81..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryLibraryResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetLibraryLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetLibraryLibraryResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetLibraryLibraryResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetLibraryLibraryResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetLibraryLibraryResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetLibraryLibraryResponseBody other = (GetLibraryLibraryResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetLibraryLibraryResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetLibraryLibraryResponseBody build() { - return new GetLibraryLibraryResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryMediaContainer.java index 60b4dede..e9b6755b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -79,6 +80,7 @@ public class GetLibraryMediaContainer { @JsonProperty("FieldType") private Optional> fieldType; + @JsonCreator public GetLibraryMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowSync") Optional allowSync, @@ -126,65 +128,99 @@ public class GetLibraryMediaContainer { this.type = type; this.fieldType = fieldType; } - - public Optional size() { - return size; + + public GetLibraryMediaContainer() { + 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()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional content() { - return content; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional content() { + return (Optional) content; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; } - public Optional mediaTagPrefix() { - return mediaTagPrefix; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional mediaTagVersion() { - return mediaTagVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagPrefix() { + return (Optional) mediaTagPrefix; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagVersion() { + return (Optional) mediaTagVersion; } - public Optional title1() { - return title1; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional viewGroup() { - return viewGroup; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title1() { + return (Optional) title1; } - public Optional viewMode() { - return viewMode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewGroup() { + return (Optional) viewGroup; } - public Optional> directory() { - return directory; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewMode() { + return (Optional) viewMode; } - public Optional> type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> directory() { + return (Optional>) directory; } - public Optional> fieldType() { - return fieldType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> type() { + return (Optional>) type; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> fieldType() { + return (Optional>) fieldType; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryRequest.java index ad2bbc4a..936e51c3 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -15,7 +17,6 @@ import lukehagar.plexapi.plexapi.utils.LazySingletonValue; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryRequest { /** @@ -32,6 +33,7 @@ public class GetLibraryRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDetails") private Optional includeDetails; + @JsonCreator public GetLibraryRequest( double sectionId, Optional includeDetails) { @@ -40,10 +42,16 @@ public class GetLibraryRequest { this.sectionId = sectionId; this.includeDetails = includeDetails; } + + public GetLibraryRequest( + double sectionId) { + this(sectionId, Optional.empty()); + } /** * the Id of the library to query */ + @JsonIgnore public double sectionId() { return sectionId; } @@ -53,8 +61,10 @@ public class GetLibraryRequest { * Only exists for backwards compatibility, media providers other than the server libraries have it on always. * */ - public Optional includeDetails() { - return includeDetails; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional includeDetails() { + return (Optional) includeDetails; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryResponse.java index 00633097..8d74462c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * The details of the library */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetLibraryResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + this.object = object; + } + + public GetLibraryResponse( + 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; } @@ -70,6 +72,7 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * The details of the library */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * The details of the library */ - public GetLibraryResponse withTwoHundredApplicationJsonObject(GetLibraryResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetLibraryResponse withObject(GetLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The details of the library */ - public GetLibraryResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetLibraryResponse withFourHundredAndOneApplicationJsonObject(GetLibraryLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetLibraryResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetLibraryResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * The details of the library */ - public Builder twoHundredApplicationJsonObject(GetLibraryResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The details of the library */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetLibraryLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetLibraryResponse implements lukehagar.plexapi.plexapi.utils.Respo contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryResponseBody.java index 5fa09c4c..c23b0c7e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetLibraryResponseBody - The details of the library */ @@ -26,14 +27,21 @@ public class GetLibraryResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetLibraryResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetLibraryResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryType.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryType.java index 26bb80cc..a0f6ee3d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryType.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetLibraryType.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetLibraryType { @JsonInclude(Include.NON_ABSENT) @@ -37,7 +38,7 @@ public class GetLibraryType { @JsonInclude(Include.NON_ABSENT) @JsonProperty("Filter") - private Optional> filter; + private Optional> filter; @JsonInclude(Include.NON_ABSENT) @JsonProperty("Sort") @@ -47,12 +48,13 @@ public class GetLibraryType { @JsonProperty("Field") private Optional> field; + @JsonCreator public GetLibraryType( @JsonProperty("key") Optional key, @JsonProperty("type") Optional type, @JsonProperty("title") Optional title, @JsonProperty("active") Optional active, - @JsonProperty("Filter") Optional> filter, + @JsonProperty("Filter") Optional> filter, @JsonProperty("Sort") Optional> sort, @JsonProperty("Field") Optional> field) { Utils.checkNotNull(key, "key"); @@ -70,33 +72,51 @@ public class GetLibraryType { this.sort = sort; this.field = field; } - - public Optional key() { - return key; + + public GetLibraryType() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional active() { - return active; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional> filter() { - return filter; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional active() { + return (Optional) active; } - public Optional> sort() { - return sort; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> filter() { + return (Optional>) filter; } - public Optional> field() { - return field; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> sort() { + return (Optional>) sort; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> field() { + return (Optional>) field; } public final static Builder builder() { @@ -151,13 +171,13 @@ public class GetLibraryType { return this; } - public GetLibraryType withFilter(java.util.List filter) { + public GetLibraryType withFilter(java.util.List filter) { Utils.checkNotNull(filter, "filter"); this.filter = Optional.ofNullable(filter); return this; } - public GetLibraryType withFilter(Optional> filter) { + public GetLibraryType withFilter(Optional> filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; @@ -240,7 +260,7 @@ public class GetLibraryType { private Optional active = Optional.empty(); - private Optional> filter = Optional.empty(); + private Optional> filter = Optional.empty(); private Optional> sort = Optional.empty(); @@ -298,13 +318,13 @@ public class GetLibraryType { return this; } - public Builder filter(java.util.List filter) { + public Builder filter(java.util.List filter) { Utils.checkNotNull(filter, "filter"); this.filter = Optional.ofNullable(filter); return this; } - public Builder filter(Optional> filter) { + public Builder filter(Optional> filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenDirectory.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenDirectory.java index 9b00cbe8..0aade492 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenDirectory.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenDirectory.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataChildrenDirectory { @JsonInclude(Include.NON_ABSENT) @@ -39,6 +40,7 @@ public class GetMetadataChildrenDirectory { @JsonProperty("title") private Optional title; + @JsonCreator public GetMetadataChildrenDirectory( @JsonProperty("leafCount") Optional leafCount, @JsonProperty("thumb") Optional thumb, @@ -56,25 +58,39 @@ public class GetMetadataChildrenDirectory { this.key = key; this.title = title; } - - public Optional leafCount() { - return leafCount; + + public GetMetadataChildrenDirectory() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; } - public Optional viewedLeafCount() { - return viewedLeafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewedLeafCount() { + return (Optional) viewedLeafCount; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenLibraryResponseBody.java deleted file mode 100644 index 420cde9e..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenLibraryResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetMetadataChildrenLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetMetadataChildrenLibraryResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetMetadataChildrenLibraryResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetMetadataChildrenLibraryResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetMetadataChildrenLibraryResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetMetadataChildrenLibraryResponseBody other = (GetMetadataChildrenLibraryResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetMetadataChildrenLibraryResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetMetadataChildrenLibraryResponseBody build() { - return new GetMetadataChildrenLibraryResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenMediaContainer.java index 69a0a82c..46110177 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataChildrenMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -111,6 +112,7 @@ public class GetMetadataChildrenMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public GetMetadataChildrenMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowSync") Optional allowSync, @@ -182,97 +184,147 @@ public class GetMetadataChildrenMediaContainer { this.directory = directory; this.metadata = metadata; } - - public Optional size() { - return size; + + 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()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional librarySectionUUID() { - return librarySectionUUID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; } - public Optional mediaTagPrefix() { - return mediaTagPrefix; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionUUID() { + return (Optional) librarySectionUUID; } - public Optional mediaTagVersion() { - return mediaTagVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagPrefix() { + return (Optional) mediaTagPrefix; } - public Optional nocache() { - return nocache; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagVersion() { + return (Optional) mediaTagVersion; } - public Optional parentIndex() { - return parentIndex; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional nocache() { + return (Optional) nocache; } - public Optional parentTitle() { - return parentTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentIndex() { + return (Optional) parentIndex; } - public Optional parentYear() { - return parentYear; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentTitle() { + return (Optional) parentTitle; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentYear() { + return (Optional) parentYear; } - public Optional theme() { - return theme; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional theme() { + return (Optional) theme; } - public Optional title1() { - return title1; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional title2() { - return title2; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title1() { + return (Optional) title1; } - public Optional viewGroup() { - return viewGroup; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title2() { + return (Optional) title2; } - public Optional viewMode() { - return viewMode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewGroup() { + return (Optional) viewGroup; } - public Optional> directory() { - return directory; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewMode() { + return (Optional) viewMode; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> directory() { + return (Optional>) directory; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenMetadata.java index 509e2823..154c9547 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataChildrenMetadata { @JsonInclude(Include.NON_ABSENT) @@ -127,6 +128,7 @@ public class GetMetadataChildrenMetadata { @JsonProperty("lastRatedAt") private Optional lastRatedAt; + @JsonCreator public GetMetadataChildrenMetadata( @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("key") Optional key, @@ -210,113 +212,171 @@ public class GetMetadataChildrenMetadata { this.skipCount = skipCount; this.lastRatedAt = lastRatedAt; } - - public Optional ratingKey() { - return ratingKey; + + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional parentRatingKey() { - return parentRatingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentRatingKey() { + return (Optional) parentRatingKey; } - public Optional parentGuid() { - return parentGuid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional parentStudio() { - return parentStudio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentGuid() { + return (Optional) parentGuid; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentStudio() { + return (Optional) parentStudio; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional parentKey() { - return parentKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional parentTitle() { - return parentTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentKey() { + return (Optional) parentKey; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentTitle() { + return (Optional) parentTitle; } - public Optional index() { - return index; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional parentIndex() { - return parentIndex; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional index() { + return (Optional) index; } - public Optional viewCount() { - return viewCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentIndex() { + return (Optional) parentIndex; } - public Optional lastViewedAt() { - return lastViewedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewCount() { + return (Optional) viewCount; } - public Optional parentYear() { - return parentYear; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastViewedAt() { + return (Optional) lastViewedAt; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentYear() { + return (Optional) parentYear; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional parentThumb() { - return parentThumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional parentTheme() { - return parentTheme; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentThumb() { + return (Optional) parentThumb; } - public Optional leafCount() { - return leafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentTheme() { + return (Optional) parentTheme; } - public Optional viewedLeafCount() { - return viewedLeafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewedLeafCount() { + return (Optional) viewedLeafCount; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; } - public Optional userRating() { - return userRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional skipCount() { - return skipCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userRating() { + return (Optional) userRating; } - public Optional lastRatedAt() { - return lastRatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional skipCount() { + return (Optional) skipCount; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastRatedAt() { + return (Optional) lastRatedAt; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenRequest.java index 0da41161..35f42b87 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenRequest.java @@ -4,16 +4,18 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataChildrenRequest { /** @@ -22,19 +24,46 @@ public class GetMetadataChildrenRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey") private double ratingKey; + /** + * Adds additional elements to the response. Supported types are (Stream) + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeElements") + private Optional includeElements; + + @JsonCreator + public GetMetadataChildrenRequest( + double ratingKey, + Optional includeElements) { + Utils.checkNotNull(ratingKey, "ratingKey"); + Utils.checkNotNull(includeElements, "includeElements"); + this.ratingKey = ratingKey; + this.includeElements = includeElements; + } + public GetMetadataChildrenRequest( double ratingKey) { - Utils.checkNotNull(ratingKey, "ratingKey"); - this.ratingKey = ratingKey; + this(ratingKey, Optional.empty()); } /** * the id of the library item to return the children of. */ + @JsonIgnore public double ratingKey() { return ratingKey; } + /** + * Adds additional elements to the response. Supported types are (Stream) + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional includeElements() { + return (Optional) includeElements; + } + public final static Builder builder() { return new Builder(); } @@ -47,6 +76,26 @@ public class GetMetadataChildrenRequest { this.ratingKey = ratingKey; return this; } + + /** + * Adds additional elements to the response. Supported types are (Stream) + * + */ + public GetMetadataChildrenRequest withIncludeElements(String includeElements) { + Utils.checkNotNull(includeElements, "includeElements"); + this.includeElements = Optional.ofNullable(includeElements); + return this; + } + + /** + * Adds additional elements to the response. Supported types are (Stream) + * + */ + public GetMetadataChildrenRequest withIncludeElements(Optional includeElements) { + Utils.checkNotNull(includeElements, "includeElements"); + this.includeElements = includeElements; + return this; + } @Override public boolean equals(java.lang.Object o) { @@ -58,24 +107,29 @@ public class GetMetadataChildrenRequest { } GetMetadataChildrenRequest other = (GetMetadataChildrenRequest) o; return - java.util.Objects.deepEquals(this.ratingKey, other.ratingKey); + java.util.Objects.deepEquals(this.ratingKey, other.ratingKey) && + java.util.Objects.deepEquals(this.includeElements, other.includeElements); } @Override public int hashCode() { return java.util.Objects.hash( - ratingKey); + ratingKey, + includeElements); } @Override public String toString() { return Utils.toString(GetMetadataChildrenRequest.class, - "ratingKey", ratingKey); + "ratingKey", ratingKey, + "includeElements", includeElements); } public final static class Builder { - private Double ratingKey; + private Double ratingKey; + + private Optional includeElements = Optional.empty(); private Builder() { // force use of static builder() method @@ -89,10 +143,31 @@ public class GetMetadataChildrenRequest { this.ratingKey = ratingKey; return this; } + + /** + * Adds additional elements to the response. Supported types are (Stream) + * + */ + public Builder includeElements(String includeElements) { + Utils.checkNotNull(includeElements, "includeElements"); + this.includeElements = Optional.ofNullable(includeElements); + return this; + } + + /** + * Adds additional elements to the response. Supported types are (Stream) + * + */ + public Builder includeElements(Optional includeElements) { + Utils.checkNotNull(includeElements, "includeElements"); + this.includeElements = includeElements; + return this; + } public GetMetadataChildrenRequest build() { return new GetMetadataChildrenRequest( - ratingKey); + ratingKey, + includeElements); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenRequestBuilder.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenRequestBuilder.java index aa49def8..d5cbb61b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenRequestBuilder.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenRequestBuilder.java @@ -20,6 +20,7 @@ import org.openapitools.jackson.nullable.JsonNullable; public class GetMetadataChildrenRequestBuilder { private Double ratingKey; + private Optional includeElements = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetMetadataChildren sdk; public GetMetadataChildrenRequestBuilder(SDKMethodInterfaces.MethodCallGetMetadataChildren sdk) { @@ -31,10 +32,23 @@ public class GetMetadataChildrenRequestBuilder { 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; + } public GetMetadataChildrenResponse call() throws Exception { return sdk.getMetadataChildren( - ratingKey); + ratingKey, + includeElements); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenResponse.java index f2e84293..7fc98659 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut /** * The children of the library item. */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetMetadataChildrenResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut /** * The children of the library item. */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut /** * The children of the library item. */ - public GetMetadataChildrenResponse withTwoHundredApplicationJsonObject(GetMetadataChildrenResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetMetadataChildrenResponse withObject(GetMetadataChildrenResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The children of the library item. */ - public GetMetadataChildrenResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetMetadataChildrenResponse withFourHundredAndOneApplicationJsonObject(GetMetadataChildrenLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetMetadataChildrenResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetMetadataChildrenResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut /** * The children of the library item. */ - public Builder twoHundredApplicationJsonObject(GetMetadataChildrenResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetMetadataChildrenResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The children of the library item. */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetMetadataChildrenLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetMetadataChildrenResponse implements lukehagar.plexapi.plexapi.ut contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenResponseBody.java index 39ffe0e7..855122e1 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataChildrenResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetMetadataChildrenResponseBody - The children of the library item. */ @@ -26,14 +27,21 @@ public class GetMetadataChildrenResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetMetadataChildrenResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetMetadataChildrenResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataCountry.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataCountry.java index 5eedc72e..ceaf3437 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataCountry.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataCountry.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataCountry { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetMetadataCountry { @JsonProperty("tag") private Optional tag; + @JsonCreator public GetMetadataCountry( @JsonProperty("id") Optional id, @JsonProperty("filter") Optional filter, @@ -42,17 +44,27 @@ public class GetMetadataCountry { this.filter = filter; this.tag = tag; } - - public Optional id() { - return id; + + public GetMetadataCountry() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional filter() { - return filter; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataDirector.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataDirector.java index 0745893e..39b85b0b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataDirector.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataDirector.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataDirector { @JsonInclude(Include.NON_ABSENT) @@ -39,6 +40,7 @@ public class GetMetadataDirector { @JsonProperty("thumb") private Optional thumb; + @JsonCreator public GetMetadataDirector( @JsonProperty("id") Optional id, @JsonProperty("filter") Optional filter, @@ -56,25 +58,39 @@ public class GetMetadataDirector { this.tagKey = tagKey; this.thumb = thumb; } - - public Optional id() { - return id; + + public GetMetadataDirector() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional filter() { - return filter; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; } - public Optional tagKey() { - return tagKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagKey() { + return (Optional) tagKey; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataGenre.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataGenre.java index afbc7c05..adee7be6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataGenre.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataGenre.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataGenre { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class GetMetadataGenre { @JsonProperty("tag") private Optional tag; + @JsonCreator public GetMetadataGenre( @JsonProperty("id") Optional id, @JsonProperty("filter") Optional filter, @@ -42,17 +44,27 @@ public class GetMetadataGenre { this.filter = filter; this.tag = tag; } - - public Optional id() { - return id; + + public GetMetadataGenre() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional filter() { - return filter; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataLibraryResponseBody.java deleted file mode 100644 index 4b6147e4..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataLibraryResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetMetadataLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetMetadataLibraryResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetMetadataLibraryResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetMetadataLibraryResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetMetadataLibraryResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetMetadataLibraryResponseBody other = (GetMetadataLibraryResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetMetadataLibraryResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetMetadataLibraryResponseBody build() { - return new GetMetadataLibraryResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMedia.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMedia.java index 2c4a48f6..6b2a484e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMedia.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMedia.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataMedia { @JsonInclude(Include.NON_ABSENT) @@ -87,6 +88,7 @@ public class GetMetadataMedia { @JsonProperty("Part") private Optional> part; + @JsonCreator public GetMetadataMedia( @JsonProperty("id") Optional id, @JsonProperty("duration") Optional duration, @@ -140,73 +142,111 @@ public class GetMetadataMedia { this.videoProfile = videoProfile; this.part = part; } - - public Optional id() { - return id; + + public GetMetadataMedia() { + 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()); } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional width() { - return width; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional height() { - return height; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional width() { + return (Optional) width; } - public Optional aspectRatio() { - return aspectRatio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional height() { + return (Optional) height; } - public Optional audioChannels() { - return audioChannels; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional aspectRatio() { + return (Optional) aspectRatio; } - public Optional audioCodec() { - return audioCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioChannels() { + return (Optional) audioChannels; } - public Optional videoCodec() { - return videoCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioCodec() { + return (Optional) audioCodec; } - public Optional videoResolution() { - return videoResolution; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoCodec() { + return (Optional) videoCodec; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoResolution() { + return (Optional) videoResolution; } - public Optional videoFrameRate() { - return videoFrameRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional optimizedForStreaming() { - return optimizedForStreaming; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoFrameRate() { + return (Optional) videoFrameRate; } - public Optional audioProfile() { - return audioProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional optimizedForStreaming() { + return (Optional) optimizedForStreaming; } - public Optional has64bitOffsets() { - return has64bitOffsets; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioProfile() { + return (Optional) audioProfile; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional has64bitOffsets() { + return (Optional) has64bitOffsets; } - public Optional> part() { - return part; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> part() { + return (Optional>) part; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMediaContainer.java index 2be5e9ec..77fe06e6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -55,6 +56,7 @@ public class GetMetadataMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public GetMetadataMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowSync") Optional allowSync, @@ -84,41 +86,63 @@ public class GetMetadataMediaContainer { this.mediaTagVersion = mediaTagVersion; this.metadata = metadata; } - - public Optional size() { - return size; + + public GetMetadataMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional librarySectionUUID() { - return librarySectionUUID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; } - public Optional mediaTagPrefix() { - return mediaTagPrefix; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionUUID() { + return (Optional) librarySectionUUID; } - public Optional mediaTagVersion() { - return mediaTagVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagPrefix() { + return (Optional) mediaTagPrefix; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagVersion() { + return (Optional) mediaTagVersion; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMetadata.java index 5620c38b..aae9eade 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -17,7 +19,6 @@ import java.time.LocalDate; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataMetadata { @JsonInclude(Include.NON_ABSENT) @@ -152,6 +153,7 @@ public class GetMetadataMetadata { @JsonProperty("Producer") private Optional> producer; + @JsonCreator public GetMetadataMetadata( @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("key") Optional key, @@ -253,137 +255,207 @@ public class GetMetadataMetadata { this.role = role; this.producer = producer; } - - public Optional ratingKey() { - return ratingKey; + + public GetMetadataMetadata() { + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional studio() { - return studio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional studio() { + return (Optional) studio; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; } - public Optional librarySectionKey() { - return librarySectionKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional contentRating() { - return contentRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionKey() { + return (Optional) librarySectionKey; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional contentRating() { + return (Optional) contentRating; } - public Optional rating() { - return rating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional audienceRating() { - return audienceRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional rating() { + return (Optional) rating; } - public Optional year() { - return year; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRating() { + return (Optional) audienceRating; } - public Optional tagline() { - return tagline; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional year() { + return (Optional) year; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagline() { + return (Optional) tagline; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional originallyAvailableAt() { - return originallyAvailableAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originallyAvailableAt() { + return (Optional) originallyAvailableAt; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; } - public Optional audienceRatingImage() { - return audienceRatingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional hasPremiumPrimaryExtra() { - return hasPremiumPrimaryExtra; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRatingImage() { + return (Optional) audienceRatingImage; } - public Optional ratingImage() { - return ratingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasPremiumPrimaryExtra() { + return (Optional) hasPremiumPrimaryExtra; } - public Optional> media() { - return media; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingImage() { + return (Optional) ratingImage; } - public Optional> genre() { - return genre; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> media() { + return (Optional>) media; } - public Optional> country() { - return country; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> genre() { + return (Optional>) genre; } - public Optional> guids() { - return guids; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> country() { + return (Optional>) country; } - public Optional> ratings() { - return ratings; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> guids() { + return (Optional>) guids; } - public Optional> director() { - return director; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> ratings() { + return (Optional>) ratings; } - public Optional> writer() { - return writer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> director() { + return (Optional>) director; } - public Optional> role() { - return role; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> writer() { + return (Optional>) writer; } - public Optional> producer() { - return producer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> role() { + return (Optional>) role; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> producer() { + return (Optional>) producer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataPart.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataPart.java index 79193e08..6d065832 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataPart.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataPart.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataPart { @JsonInclude(Include.NON_ABSENT) @@ -63,6 +64,7 @@ public class GetMetadataPart { @JsonProperty("Stream") private Optional> stream; + @JsonCreator public GetMetadataPart( @JsonProperty("id") Optional id, @JsonProperty("key") Optional key, @@ -98,49 +100,75 @@ public class GetMetadataPart { this.videoProfile = videoProfile; this.stream = stream; } - - public Optional id() { - return id; + + public GetMetadataPart() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional file() { - return file; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional file() { + return (Optional) file; } - public Optional audioProfile() { - return audioProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioProfile() { + return (Optional) audioProfile; } - public Optional has64bitOffsets() { - return has64bitOffsets; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional optimizedForStreaming() { - return optimizedForStreaming; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional has64bitOffsets() { + return (Optional) has64bitOffsets; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional optimizedForStreaming() { + return (Optional) optimizedForStreaming; } - public Optional> stream() { - return stream; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> stream() { + return (Optional>) stream; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataRequest.java index ac88010d..41043e7b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataRequest { /** @@ -22,6 +23,7 @@ public class GetMetadataRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey") private double ratingKey; + @JsonCreator public GetMetadataRequest( double ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); @@ -31,6 +33,7 @@ public class GetMetadataRequest { /** * the id of the library item to return the children of. */ + @JsonIgnore public double ratingKey() { return ratingKey; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataResponse.java index bc74c6db..25009d0c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * The metadata of the library item. */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetMetadataResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + this.object = object; + } + + public GetMetadataResponse( + 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; } @@ -70,6 +72,7 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * The metadata of the library item. */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * The metadata of the library item. */ - public GetMetadataResponse withTwoHundredApplicationJsonObject(GetMetadataResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetMetadataResponse withObject(GetMetadataResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The metadata of the library item. */ - public GetMetadataResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetMetadataResponse withFourHundredAndOneApplicationJsonObject(GetMetadataLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetMetadataResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetMetadataResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * The metadata of the library item. */ - public Builder twoHundredApplicationJsonObject(GetMetadataResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetMetadataResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The metadata of the library item. */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetMetadataLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetMetadataResponse implements lukehagar.plexapi.plexapi.utils.Resp contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataResponseBody.java index 2a86484b..3a4b4657 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetMetadataResponseBody - The metadata of the library item. */ @@ -26,14 +27,21 @@ public class GetMetadataResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetMetadataResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetMetadataResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataRole.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataRole.java index 0e3850c1..3c573a01 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataRole.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataRole.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataRole { @JsonInclude(Include.NON_ABSENT) @@ -43,6 +44,7 @@ public class GetMetadataRole { @JsonProperty("thumb") private Optional thumb; + @JsonCreator public GetMetadataRole( @JsonProperty("id") Optional id, @JsonProperty("filter") Optional filter, @@ -63,29 +65,45 @@ public class GetMetadataRole { this.role = role; this.thumb = thumb; } - - public Optional id() { - return id; + + public GetMetadataRole() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional filter() { - return filter; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; } - public Optional tagKey() { - return tagKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } - public Optional role() { - return role; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagKey() { + return (Optional) tagKey; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional role() { + return (Optional) role; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataWriter.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataWriter.java index 42c2e6bc..48d2ed00 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataWriter.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMetadataWriter.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMetadataWriter { @JsonInclude(Include.NON_ABSENT) @@ -39,6 +40,7 @@ public class GetMetadataWriter { @JsonProperty("thumb") private Optional thumb; + @JsonCreator public GetMetadataWriter( @JsonProperty("id") Optional id, @JsonProperty("filter") Optional filter, @@ -56,25 +58,39 @@ public class GetMetadataWriter { this.tagKey = tagKey; this.thumb = thumb; } - - public Optional id() { - return id; + + public GetMetadataWriter() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional filter() { - return filter; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; } - public Optional tagKey() { - return tagKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagKey() { + return (Optional) tagKey; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountResponse.java index 6ffd304c..3d07ae7f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils /** * MyPlex Account */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetMyPlexAccountResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils /** * MyPlex Account */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils /** * MyPlex Account */ - public GetMyPlexAccountResponse withTwoHundredApplicationJsonObject(GetMyPlexAccountResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetMyPlexAccountResponse withObject(GetMyPlexAccountResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * MyPlex Account */ - public GetMyPlexAccountResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetMyPlexAccountResponse withFourHundredAndOneApplicationJsonObject(GetMyPlexAccountServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetMyPlexAccountResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetMyPlexAccountResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils /** * MyPlex Account */ - public Builder twoHundredApplicationJsonObject(GetMyPlexAccountResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetMyPlexAccountResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * MyPlex Account */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetMyPlexAccountServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetMyPlexAccountResponse implements lukehagar.plexapi.plexapi.utils contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountResponseBody.java index 0f65bd70..ea4d54aa 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetMyPlexAccountResponseBody - MyPlex Account */ @@ -26,14 +27,21 @@ public class GetMyPlexAccountResponseBody { @JsonProperty("MyPlex") private Optional myPlex; + @JsonCreator public GetMyPlexAccountResponseBody( @JsonProperty("MyPlex") Optional myPlex) { Utils.checkNotNull(myPlex, "myPlex"); this.myPlex = myPlex; } + + public GetMyPlexAccountResponseBody() { + this(Optional.empty()); + } - public Optional myPlex() { - return myPlex; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional myPlex() { + return (Optional) myPlex; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountServerResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountServerResponseBody.java deleted file mode 100644 index 7f3dd589..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetMyPlexAccountServerResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetMyPlexAccountServerResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetMyPlexAccountServerResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetMyPlexAccountServerResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetMyPlexAccountServerResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetMyPlexAccountServerResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetMyPlexAccountServerResponseBody other = (GetMyPlexAccountServerResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetMyPlexAccountServerResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetMyPlexAccountServerResponseBody build() { - return new GetMyPlexAccountServerResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckGuids.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckGuids.java index 10770b8d..da8ab0ae 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckGuids.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckGuids.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetOnDeckGuids { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonCreator public GetOnDeckGuids( @JsonProperty("id") Optional id) { Utils.checkNotNull(id, "id"); this.id = id; } + + public GetOnDeckGuids() { + this(Optional.empty()); + } - public Optional id() { - return id; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckLibraryResponseBody.java deleted file mode 100644 index 45013305..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckLibraryResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetOnDeckLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetOnDeckLibraryResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetOnDeckLibraryResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetOnDeckLibraryResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetOnDeckLibraryResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetOnDeckLibraryResponseBody other = (GetOnDeckLibraryResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetOnDeckLibraryResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetOnDeckLibraryResponseBody build() { - return new GetOnDeckLibraryResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMedia.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMedia.java index 6f8bbe02..1b45b9fe 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMedia.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMedia.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetOnDeckMedia { @JsonInclude(Include.NON_ABSENT) @@ -79,6 +80,7 @@ public class GetOnDeckMedia { @JsonProperty("Part") private Optional> part; + @JsonCreator public GetOnDeckMedia( @JsonProperty("id") Optional id, @JsonProperty("duration") Optional duration, @@ -126,65 +128,99 @@ public class GetOnDeckMedia { this.videoProfile = videoProfile; this.part = part; } - - public Optional id() { - return id; + + public GetOnDeckMedia() { + 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()); } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional width() { - return width; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional height() { - return height; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional width() { + return (Optional) width; } - public Optional aspectRatio() { - return aspectRatio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional height() { + return (Optional) height; } - public Optional audioChannels() { - return audioChannels; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional aspectRatio() { + return (Optional) aspectRatio; } - public Optional audioCodec() { - return audioCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioChannels() { + return (Optional) audioChannels; } - public Optional videoCodec() { - return videoCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioCodec() { + return (Optional) audioCodec; } - public Optional videoResolution() { - return videoResolution; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoCodec() { + return (Optional) videoCodec; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoResolution() { + return (Optional) videoResolution; } - public Optional videoFrameRate() { - return videoFrameRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional audioProfile() { - return audioProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoFrameRate() { + return (Optional) videoFrameRate; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioProfile() { + return (Optional) audioProfile; } - public Optional> part() { - return part; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> part() { + return (Optional>) part; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMediaContainer.java index 648f9935..04961f8d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetOnDeckMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -47,6 +48,7 @@ public class GetOnDeckMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public GetOnDeckMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowSync") Optional allowSync, @@ -70,33 +72,51 @@ public class GetOnDeckMediaContainer { this.mixedParents = mixedParents; this.metadata = metadata; } - - public Optional size() { - return size; + + public GetOnDeckMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional mediaTagPrefix() { - return mediaTagPrefix; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; } - public Optional mediaTagVersion() { - return mediaTagVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagPrefix() { + return (Optional) mediaTagPrefix; } - public Optional mixedParents() { - return mixedParents; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagVersion() { + return (Optional) mediaTagVersion; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mixedParents() { + return (Optional) mixedParents; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMetadata.java index cc3ea234..14d5688e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -19,7 +21,6 @@ import java.time.OffsetDateTime; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetOnDeckMetadata { @JsonInclude(Include.NON_ABSENT) @@ -166,6 +167,7 @@ public class GetOnDeckMetadata { @JsonProperty("Guid") private Optional> guids; + @JsonCreator public GetOnDeckMetadata( @JsonProperty("allowSync") Optional allowSync, @JsonProperty("librarySectionID") Optional librarySectionID, @@ -276,149 +278,225 @@ public class GetOnDeckMetadata { this.media = media; this.guids = guids; } - - public Optional allowSync() { - return allowSync; + + public GetOnDeckMetadata() { + 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()); } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional librarySectionUUID() { - return librarySectionUUID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; } - public Optional ratingKey() { - return ratingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionUUID() { + return (Optional) librarySectionUUID; } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional parentRatingKey() { - return parentRatingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional grandparentRatingKey() { - return grandparentRatingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentRatingKey() { + return (Optional) parentRatingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentRatingKey() { + return (Optional) grandparentRatingKey; } - public Optional parentGuid() { - return parentGuid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional grandparentGuid() { - return grandparentGuid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentGuid() { + return (Optional) parentGuid; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentGuid() { + return (Optional) grandparentGuid; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional grandparentKey() { - return grandparentKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional parentKey() { - return parentKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentKey() { + return (Optional) grandparentKey; } - public Optional librarySectionKey() { - return librarySectionKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentKey() { + return (Optional) parentKey; } - public Optional grandparentTitle() { - return grandparentTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionKey() { + return (Optional) librarySectionKey; } - public Optional parentTitle() { - return parentTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentTitle() { + return (Optional) grandparentTitle; } - public Optional contentRating() { - return contentRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentTitle() { + return (Optional) parentTitle; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional contentRating() { + return (Optional) contentRating; } - public Optional index() { - return index; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional parentIndex() { - return parentIndex; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional index() { + return (Optional) index; } - public Optional lastViewedAt() { - return lastViewedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentIndex() { + return (Optional) parentIndex; } - public Optional year() { - return year; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastViewedAt() { + return (Optional) lastViewedAt; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional year() { + return (Optional) year; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional parentThumb() { - return parentThumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional grandparentThumb() { - return grandparentThumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentThumb() { + return (Optional) parentThumb; } - public Optional grandparentArt() { - return grandparentArt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentThumb() { + return (Optional) grandparentThumb; } - public Optional grandparentTheme() { - return grandparentTheme; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentArt() { + return (Optional) grandparentArt; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentTheme() { + return (Optional) grandparentTheme; } - public Optional originallyAvailableAt() { - return originallyAvailableAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originallyAvailableAt() { + return (Optional) originallyAvailableAt; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; } - public Optional> media() { - return media; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional> guids() { - return guids; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> media() { + return (Optional>) media; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> guids() { + return (Optional>) guids; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckPart.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckPart.java index 9ad1467f..ec348556 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckPart.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckPart.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetOnDeckPart { @JsonInclude(Include.NON_ABSENT) @@ -55,6 +56,7 @@ public class GetOnDeckPart { @JsonProperty("Stream") private Optional> stream; + @JsonCreator public GetOnDeckPart( @JsonProperty("id") Optional id, @JsonProperty("key") Optional key, @@ -84,41 +86,63 @@ public class GetOnDeckPart { this.videoProfile = videoProfile; this.stream = stream; } - - public Optional id() { - return id; + + public GetOnDeckPart() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional file() { - return file; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional file() { + return (Optional) file; } - public Optional audioProfile() { - return audioProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioProfile() { + return (Optional) audioProfile; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional> stream() { - return stream; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> stream() { + return (Optional>) stream; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckResponse.java index e1bb5da6..71e9f2ab 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon /** * The on Deck content */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetOnDeckResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + this.object = object; + } + + public GetOnDeckResponse( + 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; } @@ -70,6 +72,7 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon /** * The on Deck content */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon /** * The on Deck content */ - public GetOnDeckResponse withTwoHundredApplicationJsonObject(GetOnDeckResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetOnDeckResponse withObject(GetOnDeckResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The on Deck content */ - public GetOnDeckResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetOnDeckResponse withFourHundredAndOneApplicationJsonObject(GetOnDeckLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetOnDeckResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetOnDeckResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon /** * The on Deck content */ - public Builder twoHundredApplicationJsonObject(GetOnDeckResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetOnDeckResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The on Deck content */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetOnDeckLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetOnDeckResponse implements lukehagar.plexapi.plexapi.utils.Respon contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckResponseBody.java index bb4e438c..f478133c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetOnDeckResponseBody - The on Deck content */ @@ -26,14 +27,21 @@ public class GetOnDeckResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetOnDeckResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetOnDeckResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckStream.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckStream.java index b76b363a..89d5188c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckStream.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetOnDeckStream.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetOnDeckStream { @JsonInclude(Include.NON_ABSENT) @@ -111,6 +112,7 @@ public class GetOnDeckStream { @JsonProperty("extendedDisplayTitle") private Optional extendedDisplayTitle; + @JsonCreator public GetOnDeckStream( @JsonProperty("id") Optional id, @JsonProperty("streamType") Optional streamType, @@ -182,97 +184,147 @@ public class GetOnDeckStream { this.displayTitle = displayTitle; this.extendedDisplayTitle = extendedDisplayTitle; } - - public Optional id() { - return id; + + public GetOnDeckStream() { + 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()); } - public Optional streamType() { - return streamType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional default_() { - return default_; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional streamType() { + return (Optional) streamType; } - public Optional codec() { - return codec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional default_() { + return (Optional) default_; } - public Optional index() { - return index; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional codec() { + return (Optional) codec; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional index() { + return (Optional) index; } - public Optional language() { - return language; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional languageTag() { - return languageTag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional language() { + return (Optional) language; } - public Optional languageCode() { - return languageCode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional languageTag() { + return (Optional) languageTag; } - public Optional bitDepth() { - return bitDepth; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional languageCode() { + return (Optional) languageCode; } - public Optional chromaLocation() { - return chromaLocation; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitDepth() { + return (Optional) bitDepth; } - public Optional chromaSubsampling() { - return chromaSubsampling; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional chromaLocation() { + return (Optional) chromaLocation; } - public Optional codedHeight() { - return codedHeight; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional chromaSubsampling() { + return (Optional) chromaSubsampling; } - public Optional codedWidth() { - return codedWidth; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional codedHeight() { + return (Optional) codedHeight; } - public Optional colorRange() { - return colorRange; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional codedWidth() { + return (Optional) codedWidth; } - public Optional frameRate() { - return frameRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional colorRange() { + return (Optional) colorRange; } - public Optional height() { - return height; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional frameRate() { + return (Optional) frameRate; } - public Optional level() { - return level; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional height() { + return (Optional) height; } - public Optional profile() { - return profile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional level() { + return (Optional) level; } - public Optional refFrames() { - return refFrames; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional profile() { + return (Optional) profile; } - public Optional width() { - return width; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional refFrames() { + return (Optional) refFrames; } - public Optional displayTitle() { - return displayTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional width() { + return (Optional) width; } - public Optional extendedDisplayTitle() { - return extendedDisplayTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional displayTitle() { + return (Optional) displayTitle; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional extendedDisplayTitle() { + return (Optional) extendedDisplayTitle; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinPlexResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinPlexResponseBody.java deleted file mode 100644 index 6170ad8f..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinPlexResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetPinPlexResponseBody - X-Plex-Client-Identifier is missing - */ - -public class GetPinPlexResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetPinPlexResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetPinPlexResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetPinPlexResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetPinPlexResponseBody other = (GetPinPlexResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetPinPlexResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetPinPlexResponseBody build() { - return new GetPinPlexResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequest.java index 24447096..b75d91f4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -15,7 +17,6 @@ import lukehagar.plexapi.plexapi.utils.LazySingletonValue; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPinRequest { /** @@ -34,15 +35,31 @@ public class GetPinRequest { * */ @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier") - private String xPlexClientIdentifier; + private Optional xPlexClientIdentifier; + /** + * Product name of the application shown in the list of devices + * + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product") + private String xPlexProduct; + + @JsonCreator public GetPinRequest( Optional strong, - String xPlexClientIdentifier) { + Optional xPlexClientIdentifier, + String xPlexProduct) { Utils.checkNotNull(strong, "strong"); Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); + Utils.checkNotNull(xPlexProduct, "xPlexProduct"); this.strong = strong; this.xPlexClientIdentifier = xPlexClientIdentifier; + this.xPlexProduct = xPlexProduct; + } + + public GetPinRequest( + String xPlexProduct) { + this(Optional.empty(), Optional.empty(), xPlexProduct); } /** @@ -51,8 +68,10 @@ public class GetPinRequest { * Non-Strong codes are used for `Plex.tv/link` * */ - public Optional strong() { - return strong; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional strong() { + return (Optional) strong; } /** @@ -61,8 +80,19 @@ public class GetPinRequest { * (UUID, serial number, or other number unique per device) * */ - public String xPlexClientIdentifier() { - return xPlexClientIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional xPlexClientIdentifier() { + return (Optional) xPlexClientIdentifier; + } + + /** + * Product name of the application shown in the list of devices + * + */ + @JsonIgnore + public String xPlexProduct() { + return xPlexProduct; } public final static Builder builder() { @@ -100,10 +130,32 @@ public class GetPinRequest { * */ public GetPinRequest withXPlexClientIdentifier(String xPlexClientIdentifier) { + Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); + this.xPlexClientIdentifier = Optional.ofNullable(xPlexClientIdentifier); + return this; + } + + /** + * The unique identifier for the client application + * This is used to track the client application and its usage + * (UUID, serial number, or other number unique per device) + * + */ + public GetPinRequest withXPlexClientIdentifier(Optional xPlexClientIdentifier) { Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); this.xPlexClientIdentifier = xPlexClientIdentifier; return this; } + + /** + * Product name of the application shown in the list of devices + * + */ + public GetPinRequest withXPlexProduct(String xPlexProduct) { + Utils.checkNotNull(xPlexProduct, "xPlexProduct"); + this.xPlexProduct = xPlexProduct; + return this; + } @Override public boolean equals(java.lang.Object o) { @@ -116,28 +168,33 @@ public class GetPinRequest { GetPinRequest other = (GetPinRequest) o; return java.util.Objects.deepEquals(this.strong, other.strong) && - java.util.Objects.deepEquals(this.xPlexClientIdentifier, other.xPlexClientIdentifier); + java.util.Objects.deepEquals(this.xPlexClientIdentifier, other.xPlexClientIdentifier) && + java.util.Objects.deepEquals(this.xPlexProduct, other.xPlexProduct); } @Override public int hashCode() { return java.util.Objects.hash( strong, - xPlexClientIdentifier); + xPlexClientIdentifier, + xPlexProduct); } @Override public String toString() { return Utils.toString(GetPinRequest.class, "strong", strong, - "xPlexClientIdentifier", xPlexClientIdentifier); + "xPlexClientIdentifier", xPlexClientIdentifier, + "xPlexProduct", xPlexProduct); } public final static class Builder { private Optional strong; - private String xPlexClientIdentifier; + private Optional xPlexClientIdentifier = Optional.empty(); + + private String xPlexProduct; private Builder() { // force use of static builder() method @@ -174,10 +231,32 @@ public class GetPinRequest { * */ public Builder xPlexClientIdentifier(String xPlexClientIdentifier) { + Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); + this.xPlexClientIdentifier = Optional.ofNullable(xPlexClientIdentifier); + return this; + } + + /** + * The unique identifier for the client application + * This is used to track the client application and its usage + * (UUID, serial number, or other number unique per device) + * + */ + public Builder xPlexClientIdentifier(Optional xPlexClientIdentifier) { Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); this.xPlexClientIdentifier = xPlexClientIdentifier; return this; } + + /** + * Product name of the application shown in the list of devices + * + */ + public Builder xPlexProduct(String xPlexProduct) { + Utils.checkNotNull(xPlexProduct, "xPlexProduct"); + this.xPlexProduct = xPlexProduct; + return this; + } public GetPinRequest build() { if (strong == null) { @@ -185,7 +264,8 @@ public class GetPinRequest { } return new GetPinRequest( strong, - xPlexClientIdentifier); + xPlexClientIdentifier, + xPlexProduct); } private static final LazySingletonValue> _SINGLETON_VALUE_Strong = diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequestBuilder.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequestBuilder.java index 36440f65..efec567d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequestBuilder.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinRequestBuilder.java @@ -23,7 +23,8 @@ public class GetPinRequestBuilder { "strong", "false", new TypeReference>() {}); - private String xPlexClientIdentifier; + private Optional xPlexClientIdentifier = Optional.empty(); + private String xPlexProduct; private java.util.Optional serverURL = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetPin sdk; @@ -42,12 +43,24 @@ public class GetPinRequestBuilder { this.strong = strong; return this; } - + public GetPinRequestBuilder xPlexClientIdentifier(String xPlexClientIdentifier) { + Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); + this.xPlexClientIdentifier = Optional.of(xPlexClientIdentifier); + return this; + } + + public GetPinRequestBuilder xPlexClientIdentifier(Optional xPlexClientIdentifier) { Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); this.xPlexClientIdentifier = xPlexClientIdentifier; return this; } + + public GetPinRequestBuilder xPlexProduct(String xPlexProduct) { + Utils.checkNotNull(xPlexProduct, "xPlexProduct"); + this.xPlexProduct = xPlexProduct; + return this; + } public GetPinRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); @@ -69,6 +82,7 @@ public class GetPinRequestBuilder { return sdk.getPin( strong, xPlexClientIdentifier, + xPlexProduct, serverURL); } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponse.java index f94f4d39..7009e824 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response /** * The Pin */ - private Optional twoHundredApplicationJsonObject; - - /** - * X-Plex-Client-Identifier is missing - */ - private Optional fourHundredApplicationJsonObject; + private Optional object; + @JsonCreator public GetPinResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredApplicationJsonObject, "fourHundredApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredApplicationJsonObject = fourHundredApplicationJsonObject; + this.object = object; + } + + 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; } @@ -70,6 +72,7 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response /** * The Pin */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * X-Plex-Client-Identifier is missing - */ - public Optional fourHundredApplicationJsonObject() { - return fourHundredApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response /** * The Pin */ - public GetPinResponse withTwoHundredApplicationJsonObject(GetPinResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetPinResponse withObject(GetPinResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Pin */ - public GetPinResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * X-Plex-Client-Identifier is missing - */ - public GetPinResponse withFourHundredApplicationJsonObject(GetPinPlexResponseBody fourHundredApplicationJsonObject) { - Utils.checkNotNull(fourHundredApplicationJsonObject, "fourHundredApplicationJsonObject"); - this.fourHundredApplicationJsonObject = Optional.ofNullable(fourHundredApplicationJsonObject); - return this; - } - - /** - * X-Plex-Client-Identifier is missing - */ - public GetPinResponse withFourHundredApplicationJsonObject(Optional fourHundredApplicationJsonObject) { - Utils.checkNotNull(fourHundredApplicationJsonObject, "fourHundredApplicationJsonObject"); - this.fourHundredApplicationJsonObject = fourHundredApplicationJsonObject; + public GetPinResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredApplicationJsonObject, other.fourHundredApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredApplicationJsonObject", fourHundredApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response /** * The Pin */ - public Builder twoHundredApplicationJsonObject(GetPinResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetPinResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Pin */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * X-Plex-Client-Identifier is missing - */ - public Builder fourHundredApplicationJsonObject(GetPinPlexResponseBody fourHundredApplicationJsonObject) { - Utils.checkNotNull(fourHundredApplicationJsonObject, "fourHundredApplicationJsonObject"); - this.fourHundredApplicationJsonObject = Optional.ofNullable(fourHundredApplicationJsonObject); - return this; - } - - /** - * X-Plex-Client-Identifier is missing - */ - public Builder fourHundredApplicationJsonObject(Optional fourHundredApplicationJsonObject) { - Utils.checkNotNull(fourHundredApplicationJsonObject, "fourHundredApplicationJsonObject"); - this.fourHundredApplicationJsonObject = fourHundredApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetPinResponse implements lukehagar.plexapi.plexapi.utils.Response contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponseBody.java index 8546b9e5..571e6f4b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPinResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -18,7 +20,7 @@ import java.math.BigInteger; import java.time.OffsetDateTime; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - +import org.openapitools.jackson.nullable.JsonNullable; /** * GetPinResponseBody - The Pin */ @@ -80,8 +82,9 @@ public class GetPinResponseBody { @JsonInclude(Include.NON_ABSENT) @JsonProperty("newRegistration") - private Optional newRegistration; + private JsonNullable newRegistration; + @JsonCreator public GetPinResponseBody( @JsonProperty("id") Optional id, @JsonProperty("code") Optional code, @@ -94,7 +97,7 @@ public class GetPinResponseBody { @JsonProperty("createdAt") Optional createdAt, @JsonProperty("expiresAt") Optional expiresAt, @JsonProperty("authToken") Optional authToken, - @JsonProperty("newRegistration") Optional newRegistration) { + @JsonProperty("newRegistration") JsonNullable newRegistration) { Utils.checkNotNull(id, "id"); Utils.checkNotNull(code, "code"); Utils.checkNotNull(product, "product"); @@ -120,24 +123,36 @@ public class GetPinResponseBody { this.authToken = authToken; this.newRegistration = newRegistration; } + + public GetPinResponseBody() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined()); + } /** * PinID for use with authentication */ - public Optional id() { - return id; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional code() { - return code; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional product() { - return product; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional product() { + return (Optional) product; } - public Optional trusted() { - return trusted; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional trusted() { + return (Optional) trusted; } /** @@ -146,36 +161,52 @@ public class GetPinResponseBody { * Which then prompts the user for the 4 Digit Link Pin * */ - public Optional qr() { - return qr; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional qr() { + return (Optional) qr; } - public Optional clientIdentifier() { - return clientIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional clientIdentifier() { + return (Optional) clientIdentifier; } - public Optional location() { - return location; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional location() { + return (Optional) location; } - public Optional expiresIn() { - return expiresIn; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional expiresIn() { + return (Optional) expiresIn; } - public Optional createdAt() { - return createdAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; } - public Optional expiresAt() { - return expiresAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional expiresAt() { + return (Optional) expiresAt; } - public Optional authToken() { - return authToken; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional authToken() { + return (Optional) authToken; } - public Optional newRegistration() { - return newRegistration; + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable newRegistration() { + return (JsonNullable) newRegistration; } public final static Builder builder() { @@ -332,13 +363,13 @@ public class GetPinResponseBody { return this; } - public GetPinResponseBody withNewRegistration(String newRegistration) { + public GetPinResponseBody withNewRegistration(boolean newRegistration) { Utils.checkNotNull(newRegistration, "newRegistration"); - this.newRegistration = Optional.ofNullable(newRegistration); + this.newRegistration = JsonNullable.of(newRegistration); return this; } - public GetPinResponseBody withNewRegistration(Optional newRegistration) { + public GetPinResponseBody withNewRegistration(JsonNullable newRegistration) { Utils.checkNotNull(newRegistration, "newRegistration"); this.newRegistration = newRegistration; return this; @@ -426,7 +457,7 @@ public class GetPinResponseBody { private Optional authToken = Optional.empty(); - private Optional newRegistration = Optional.empty(); + private JsonNullable newRegistration = JsonNullable.undefined(); private Builder() { // force use of static builder() method @@ -582,13 +613,13 @@ public class GetPinResponseBody { return this; } - public Builder newRegistration(String newRegistration) { + public Builder newRegistration(boolean newRegistration) { Utils.checkNotNull(newRegistration, "newRegistration"); - this.newRegistration = Optional.ofNullable(newRegistration); + this.newRegistration = JsonNullable.of(newRegistration); return this; } - public Builder newRegistration(Optional newRegistration) { + public Builder newRegistration(JsonNullable newRegistration) { Utils.checkNotNull(newRegistration, "newRegistration"); this.newRegistration = newRegistration; return this; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsCountry.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsCountry.java index 387f0684..5a5a3aaa 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsCountry.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsCountry.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsCountry { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetPlaylistContentsCountry( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetPlaylistContentsCountry() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsDirector.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsDirector.java index 021215ba..31482e58 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsDirector.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsDirector.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsDirector { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetPlaylistContentsDirector( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetPlaylistContentsDirector() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsGenre.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsGenre.java index 1199d97c..ea3ce41b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsGenre.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsGenre.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsGenre { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetPlaylistContentsGenre( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetPlaylistContentsGenre() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMedia.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMedia.java index cb003d4e..b3cb95b3 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMedia.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMedia.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsMedia { @JsonInclude(Include.NON_ABSENT) @@ -87,6 +88,7 @@ public class GetPlaylistContentsMedia { @JsonProperty("Part") private Optional> part; + @JsonCreator public GetPlaylistContentsMedia( @JsonProperty("id") Optional id, @JsonProperty("duration") Optional duration, @@ -140,73 +142,111 @@ public class GetPlaylistContentsMedia { this.videoProfile = videoProfile; this.part = part; } - - public Optional id() { - return id; + + 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()); } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional width() { - return width; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional height() { - return height; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional width() { + return (Optional) width; } - public Optional aspectRatio() { - return aspectRatio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional height() { + return (Optional) height; } - public Optional audioChannels() { - return audioChannels; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional aspectRatio() { + return (Optional) aspectRatio; } - public Optional audioCodec() { - return audioCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioChannels() { + return (Optional) audioChannels; } - public Optional videoCodec() { - return videoCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioCodec() { + return (Optional) audioCodec; } - public Optional videoResolution() { - return videoResolution; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoCodec() { + return (Optional) videoCodec; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoResolution() { + return (Optional) videoResolution; } - public Optional videoFrameRate() { - return videoFrameRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional optimizedForStreaming() { - return optimizedForStreaming; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoFrameRate() { + return (Optional) videoFrameRate; } - public Optional audioProfile() { - return audioProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional optimizedForStreaming() { + return (Optional) optimizedForStreaming; } - public Optional has64bitOffsets() { - return has64bitOffsets; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioProfile() { + return (Optional) audioProfile; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional has64bitOffsets() { + return (Optional) has64bitOffsets; } - public Optional> part() { - return part; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> part() { + return (Optional>) part; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMediaContainer.java index f69686c7..b5428043 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -55,6 +56,7 @@ public class GetPlaylistContentsMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public GetPlaylistContentsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("composite") Optional composite, @@ -84,41 +86,63 @@ public class GetPlaylistContentsMediaContainer { this.title = title; this.metadata = metadata; } - - public Optional size() { - return size; + + public GetPlaylistContentsMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional composite() { - return composite; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional composite() { + return (Optional) composite; } - public Optional leafCount() { - return leafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional playlistType() { - return playlistType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; } - public Optional ratingKey() { - return ratingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional playlistType() { + return (Optional) playlistType; } - public Optional smart() { - return smart; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional smart() { + return (Optional) smart; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMetadata.java index 91e173da..59bf84f8 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -17,7 +19,6 @@ import java.time.LocalDate; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsMetadata { @JsonInclude(Include.NON_ABSENT) @@ -148,6 +149,7 @@ public class GetPlaylistContentsMetadata { @JsonProperty("Role") private Optional> role; + @JsonCreator public GetPlaylistContentsMetadata( @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("key") Optional key, @@ -246,133 +248,201 @@ public class GetPlaylistContentsMetadata { this.writer = writer; this.role = role; } - - public Optional ratingKey() { - return ratingKey; + + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional studio() { - return studio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional studio() { + return (Optional) studio; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional titleSort() { - return titleSort; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional titleSort() { + return (Optional) titleSort; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; } - public Optional librarySectionKey() { - return librarySectionKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional contentRating() { - return contentRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionKey() { + return (Optional) librarySectionKey; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional contentRating() { + return (Optional) contentRating; } - public Optional rating() { - return rating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional audienceRating() { - return audienceRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional rating() { + return (Optional) rating; } - public Optional year() { - return year; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRating() { + return (Optional) audienceRating; } - public Optional tagline() { - return tagline; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional year() { + return (Optional) year; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagline() { + return (Optional) tagline; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional originallyAvailableAt() { - return originallyAvailableAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originallyAvailableAt() { + return (Optional) originallyAvailableAt; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; } - public Optional audienceRatingImage() { - return audienceRatingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional hasPremiumExtras() { - return hasPremiumExtras; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRatingImage() { + return (Optional) audienceRatingImage; } - public Optional hasPremiumPrimaryExtra() { - return hasPremiumPrimaryExtra; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasPremiumExtras() { + return (Optional) hasPremiumExtras; } - public Optional ratingImage() { - return ratingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasPremiumPrimaryExtra() { + return (Optional) hasPremiumPrimaryExtra; } - public Optional> media() { - return media; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingImage() { + return (Optional) ratingImage; } - public Optional> genre() { - return genre; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> media() { + return (Optional>) media; } - public Optional> country() { - return country; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> genre() { + return (Optional>) genre; } - public Optional> director() { - return director; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> country() { + return (Optional>) country; } - public Optional> writer() { - return writer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> director() { + return (Optional>) director; } - public Optional> role() { - return role; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> writer() { + return (Optional>) writer; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> role() { + return (Optional>) role; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsPart.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsPart.java index f2a89fd3..044f2f7b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsPart.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsPart.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsPart { @JsonInclude(Include.NON_ABSENT) @@ -59,6 +60,7 @@ public class GetPlaylistContentsPart { @JsonProperty("videoProfile") private Optional videoProfile; + @JsonCreator public GetPlaylistContentsPart( @JsonProperty("id") Optional id, @JsonProperty("key") Optional key, @@ -91,45 +93,69 @@ public class GetPlaylistContentsPart { this.optimizedForStreaming = optimizedForStreaming; this.videoProfile = videoProfile; } - - public Optional id() { - return id; + + public GetPlaylistContentsPart() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional file() { - return file; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional file() { + return (Optional) file; } - public Optional audioProfile() { - return audioProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioProfile() { + return (Optional) audioProfile; } - public Optional has64bitOffsets() { - return has64bitOffsets; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional optimizedForStreaming() { - return optimizedForStreaming; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional has64bitOffsets() { + return (Optional) has64bitOffsets; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional optimizedForStreaming() { + return (Optional) optimizedForStreaming; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsPlaylistsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsPlaylistsResponseBody.java deleted file mode 100644 index 5c72069c..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsPlaylistsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetPlaylistContentsPlaylistsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetPlaylistContentsPlaylistsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetPlaylistContentsPlaylistsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetPlaylistContentsPlaylistsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetPlaylistContentsPlaylistsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetPlaylistContentsPlaylistsResponseBody other = (GetPlaylistContentsPlaylistsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetPlaylistContentsPlaylistsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetPlaylistContentsPlaylistsResponseBody build() { - return new GetPlaylistContentsPlaylistsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsRequest.java index 35e4111d..53be5923 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsRequest { /** @@ -28,6 +29,7 @@ public class GetPlaylistContentsRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=type") private double type; + @JsonCreator public GetPlaylistContentsRequest( double playlistID, double type) { @@ -40,6 +42,7 @@ public class GetPlaylistContentsRequest { /** * the ID of the playlist */ + @JsonIgnore public double playlistID() { return playlistID; } @@ -47,6 +50,7 @@ public class GetPlaylistContentsRequest { /** * the metadata type of the item to return */ + @JsonIgnore public double type() { return type; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsResponse.java index 8e64214c..48a4c04c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * The playlist contents */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetPlaylistContentsResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * The playlist contents */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * The playlist contents */ - public GetPlaylistContentsResponse withTwoHundredApplicationJsonObject(GetPlaylistContentsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetPlaylistContentsResponse withObject(GetPlaylistContentsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The playlist contents */ - public GetPlaylistContentsResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetPlaylistContentsResponse withFourHundredAndOneApplicationJsonObject(GetPlaylistContentsPlaylistsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetPlaylistContentsResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetPlaylistContentsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut /** * The playlist contents */ - public Builder twoHundredApplicationJsonObject(GetPlaylistContentsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetPlaylistContentsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The playlist contents */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetPlaylistContentsPlaylistsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetPlaylistContentsResponse implements lukehagar.plexapi.plexapi.ut contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsResponseBody.java index a8f2e978..627258e3 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetPlaylistContentsResponseBody - The playlist contents */ @@ -26,14 +27,21 @@ public class GetPlaylistContentsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetPlaylistContentsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetPlaylistContentsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsRole.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsRole.java index 91f2d299..5af869c6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsRole.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsRole.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsRole { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetPlaylistContentsRole( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetPlaylistContentsRole() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsWriter.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsWriter.java index 8baa3cf5..a102e58c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsWriter.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistContentsWriter.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistContentsWriter { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetPlaylistContentsWriter( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetPlaylistContentsWriter() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistMediaContainer.java index 64f4ef5f..ed9a37cf 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class GetPlaylistMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public GetPlaylistMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("Metadata") Optional> metadata) { @@ -35,13 +37,21 @@ public class GetPlaylistMediaContainer { this.size = size; this.metadata = metadata; } - - public Optional size() { - return size; + + public GetPlaylistMediaContainer() { + this(Optional.empty(), Optional.empty()); } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistMetadata.java index f591c030..be4e8586 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistMetadata { @JsonInclude(Include.NON_ABSENT) @@ -79,6 +80,7 @@ public class GetPlaylistMetadata { @JsonProperty("updatedAt") private Optional updatedAt; + @JsonCreator public GetPlaylistMetadata( @JsonProperty("content") Optional content, @JsonProperty("ratingKey") Optional ratingKey, @@ -126,65 +128,99 @@ public class GetPlaylistMetadata { this.addedAt = addedAt; this.updatedAt = updatedAt; } - - public Optional content() { - return content; + + 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()); } - public Optional ratingKey() { - return ratingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional content() { + return (Optional) content; } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional smart() { - return smart; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional playlistType() { - return playlistType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional smart() { + return (Optional) smart; } - public Optional composite() { - return composite; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional playlistType() { + return (Optional) playlistType; } - public Optional icon() { - return icon; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional composite() { + return (Optional) composite; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional icon() { + return (Optional) icon; } - public Optional leafCount() { - return leafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistPlaylistsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistPlaylistsResponseBody.java deleted file mode 100644 index e0c23df2..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistPlaylistsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetPlaylistPlaylistsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetPlaylistPlaylistsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetPlaylistPlaylistsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetPlaylistPlaylistsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetPlaylistPlaylistsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetPlaylistPlaylistsResponseBody other = (GetPlaylistPlaylistsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetPlaylistPlaylistsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetPlaylistPlaylistsResponseBody build() { - return new GetPlaylistPlaylistsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistRequest.java index 7b746f07..06e848a2 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistRequest { /** @@ -22,6 +23,7 @@ public class GetPlaylistRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=playlistID") private double playlistID; + @JsonCreator public GetPlaylistRequest( double playlistID) { Utils.checkNotNull(playlistID, "playlistID"); @@ -31,6 +33,7 @@ public class GetPlaylistRequest { /** * the ID of the playlist */ + @JsonIgnore public double playlistID() { return playlistID; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistResponse.java index 1efc71c4..4ea0c57a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * The playlist */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetPlaylistResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * The playlist */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * The playlist */ - public GetPlaylistResponse withTwoHundredApplicationJsonObject(GetPlaylistResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetPlaylistResponse withObject(GetPlaylistResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The playlist */ - public GetPlaylistResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetPlaylistResponse withFourHundredAndOneApplicationJsonObject(GetPlaylistPlaylistsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetPlaylistResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetPlaylistResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * The playlist */ - public Builder twoHundredApplicationJsonObject(GetPlaylistResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetPlaylistResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The playlist */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetPlaylistPlaylistsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Resp contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistResponseBody.java index 856db9db..beb89320 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetPlaylistResponseBody - The playlist */ @@ -26,14 +27,21 @@ public class GetPlaylistResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetPlaylistResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetPlaylistResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsMediaContainer.java index 3b9e18a8..1e3a4895 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class GetPlaylistsMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public GetPlaylistsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("Metadata") Optional> metadata) { @@ -35,13 +37,21 @@ public class GetPlaylistsMediaContainer { this.size = size; this.metadata = metadata; } - - public Optional size() { - return size; + + public GetPlaylistsMediaContainer() { + this(Optional.empty(), Optional.empty()); } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsMetadata.java index 8d303f6b..8950c643 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistsMetadata { @JsonInclude(Include.NON_ABSENT) @@ -83,6 +84,7 @@ public class GetPlaylistsMetadata { @JsonProperty("updatedAt") private Optional updatedAt; + @JsonCreator public GetPlaylistsMetadata( @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("key") Optional key, @@ -133,69 +135,105 @@ public class GetPlaylistsMetadata { this.addedAt = addedAt; this.updatedAt = updatedAt; } - - public Optional ratingKey() { - return ratingKey; + + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional smart() { - return smart; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional playlistType() { - return playlistType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional smart() { + return (Optional) smart; } - public Optional composite() { - return composite; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional playlistType() { + return (Optional) playlistType; } - public Optional icon() { - return icon; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional composite() { + return (Optional) composite; } - public Optional viewCount() { - return viewCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional icon() { + return (Optional) icon; } - public Optional lastViewedAt() { - return lastViewedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewCount() { + return (Optional) viewCount; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastViewedAt() { + return (Optional) lastViewedAt; } - public Optional leafCount() { - return leafCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsPlaylistsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsPlaylistsResponseBody.java deleted file mode 100644 index 5a8a55c6..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsPlaylistsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetPlaylistsPlaylistsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetPlaylistsPlaylistsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetPlaylistsPlaylistsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetPlaylistsPlaylistsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetPlaylistsPlaylistsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetPlaylistsPlaylistsResponseBody other = (GetPlaylistsPlaylistsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetPlaylistsPlaylistsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetPlaylistsPlaylistsResponseBody build() { - return new GetPlaylistsPlaylistsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsRequest.java index 97fe44bd..82796a49 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistsRequest { /** @@ -29,6 +30,7 @@ public class GetPlaylistsRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=smart") private Optional smart; + @JsonCreator public GetPlaylistsRequest( Optional playlistType, Optional smart) { @@ -37,19 +39,27 @@ public class GetPlaylistsRequest { this.playlistType = playlistType; this.smart = smart; } + + public GetPlaylistsRequest() { + this(Optional.empty(), Optional.empty()); + } /** * limit to a type of playlist. */ - public Optional playlistType() { - return playlistType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional playlistType() { + return (Optional) playlistType; } /** * type of playlists to return (default is all). */ - public Optional smart() { - return smart; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional smart() { + return (Optional) smart; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsResponse.java index 931cb31a..8385b499 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res /** * returns all playlists */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetPlaylistsResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res /** * returns all playlists */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res /** * returns all playlists */ - public GetPlaylistsResponse withTwoHundredApplicationJsonObject(GetPlaylistsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetPlaylistsResponse withObject(GetPlaylistsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * returns all playlists */ - public GetPlaylistsResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetPlaylistsResponse withFourHundredAndOneApplicationJsonObject(GetPlaylistsPlaylistsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetPlaylistsResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetPlaylistsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res /** * returns all playlists */ - public Builder twoHundredApplicationJsonObject(GetPlaylistsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetPlaylistsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * returns all playlists */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetPlaylistsPlaylistsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetPlaylistsResponse implements lukehagar.plexapi.plexapi.utils.Res contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsResponseBody.java index 0d0cd6b6..5b2b5046 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetPlaylistsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetPlaylistsResponseBody - returns all playlists */ @@ -26,14 +27,21 @@ public class GetPlaylistsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetPlaylistsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetPlaylistsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedLibraryResponseBody.java deleted file mode 100644 index c3ceb3bf..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedLibraryResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetRecentlyAddedLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetRecentlyAddedLibraryResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetRecentlyAddedLibraryResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetRecentlyAddedLibraryResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetRecentlyAddedLibraryResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetRecentlyAddedLibraryResponseBody other = (GetRecentlyAddedLibraryResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetRecentlyAddedLibraryResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetRecentlyAddedLibraryResponseBody build() { - return new GetRecentlyAddedLibraryResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedMediaContainer.java index 6492a37b..b3380746 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetRecentlyAddedMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -45,8 +46,9 @@ public class GetRecentlyAddedMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") - private Optional> metadata; + private Optional> metadata; + @JsonCreator public GetRecentlyAddedMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowSync") Optional allowSync, @@ -54,7 +56,7 @@ public class GetRecentlyAddedMediaContainer { @JsonProperty("mediaTagPrefix") Optional mediaTagPrefix, @JsonProperty("mediaTagVersion") Optional mediaTagVersion, @JsonProperty("mixedParents") Optional mixedParents, - @JsonProperty("Metadata") Optional> metadata) { + @JsonProperty("Metadata") Optional> metadata) { Utils.checkNotNull(size, "size"); Utils.checkNotNull(allowSync, "allowSync"); Utils.checkNotNull(identifier, "identifier"); @@ -70,33 +72,51 @@ public class GetRecentlyAddedMediaContainer { this.mixedParents = mixedParents; this.metadata = metadata; } - - public Optional size() { - return size; + + public GetRecentlyAddedMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional mediaTagPrefix() { - return mediaTagPrefix; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; } - public Optional mediaTagVersion() { - return mediaTagVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagPrefix() { + return (Optional) mediaTagPrefix; } - public Optional mixedParents() { - return mixedParents; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagVersion() { + return (Optional) mediaTagVersion; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mixedParents() { + return (Optional) mixedParents; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { @@ -175,13 +195,13 @@ public class GetRecentlyAddedMediaContainer { return this; } - public GetRecentlyAddedMediaContainer withMetadata(java.util.List metadata) { + public GetRecentlyAddedMediaContainer withMetadata(java.util.List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); return this; } - public GetRecentlyAddedMediaContainer withMetadata(Optional> metadata) { + public GetRecentlyAddedMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; @@ -244,7 +264,7 @@ public class GetRecentlyAddedMediaContainer { private Optional mixedParents = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional> metadata = Optional.empty(); private Builder() { // force use of static builder() method @@ -322,13 +342,13 @@ public class GetRecentlyAddedMediaContainer { return this; } - public Builder metadata(java.util.List metadata) { + public Builder metadata(java.util.List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); return this; } - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedMetadata.java new file mode 100644 index 00000000..d33a9877 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedMetadata.java @@ -0,0 +1,1447 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetRecentlyAddedMetadata { + + @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; + + @JsonCreator + public GetRecentlyAddedMetadata( + @JsonProperty("allowSync") Optional allowSync, + @JsonProperty("librarySectionID") Optional librarySectionID, + @JsonProperty("librarySectionTitle") Optional librarySectionTitle, + @JsonProperty("librarySectionUUID") Optional librarySectionUUID, + @JsonProperty("ratingKey") Optional ratingKey, + @JsonProperty("key") Optional key, + @JsonProperty("guid") Optional guid, + @JsonProperty("studio") Optional studio, + @JsonProperty("type") Optional type, + @JsonProperty("title") Optional title, + @JsonProperty("contentRating") Optional contentRating, + @JsonProperty("summary") Optional summary, + @JsonProperty("rating") Optional rating, + @JsonProperty("audienceRating") Optional audienceRating, + @JsonProperty("year") Optional year, + @JsonProperty("tagline") Optional tagline, + @JsonProperty("thumb") Optional thumb, + @JsonProperty("art") Optional art, + @JsonProperty("duration") Optional duration, + @JsonProperty("originallyAvailableAt") Optional originallyAvailableAt, + @JsonProperty("addedAt") Optional addedAt, + @JsonProperty("updatedAt") Optional updatedAt, + @JsonProperty("audienceRatingImage") Optional audienceRatingImage, + @JsonProperty("chapterSource") Optional chapterSource, + @JsonProperty("primaryExtraKey") Optional primaryExtraKey, + @JsonProperty("ratingImage") Optional ratingImage, + @JsonProperty("Media") Optional> media, + @JsonProperty("Genre") Optional> genre, + @JsonProperty("Director") Optional> director, + @JsonProperty("Writer") Optional> writer, + @JsonProperty("Country") Optional> country, + @JsonProperty("Role") Optional> role) { + Utils.checkNotNull(allowSync, "allowSync"); + Utils.checkNotNull(librarySectionID, "librarySectionID"); + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); + Utils.checkNotNull(ratingKey, "ratingKey"); + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(guid, "guid"); + Utils.checkNotNull(studio, "studio"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(title, "title"); + Utils.checkNotNull(contentRating, "contentRating"); + Utils.checkNotNull(summary, "summary"); + Utils.checkNotNull(rating, "rating"); + Utils.checkNotNull(audienceRating, "audienceRating"); + Utils.checkNotNull(year, "year"); + Utils.checkNotNull(tagline, "tagline"); + Utils.checkNotNull(thumb, "thumb"); + Utils.checkNotNull(art, "art"); + Utils.checkNotNull(duration, "duration"); + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + Utils.checkNotNull(addedAt, "addedAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + Utils.checkNotNull(chapterSource, "chapterSource"); + Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); + Utils.checkNotNull(ratingImage, "ratingImage"); + Utils.checkNotNull(media, "media"); + Utils.checkNotNull(genre, "genre"); + Utils.checkNotNull(director, "director"); + Utils.checkNotNull(writer, "writer"); + Utils.checkNotNull(country, "country"); + Utils.checkNotNull(role, "role"); + this.allowSync = allowSync; + this.librarySectionID = librarySectionID; + this.librarySectionTitle = librarySectionTitle; + this.librarySectionUUID = librarySectionUUID; + this.ratingKey = ratingKey; + this.key = key; + this.guid = guid; + this.studio = studio; + this.type = type; + this.title = title; + this.contentRating = contentRating; + this.summary = summary; + this.rating = rating; + this.audienceRating = audienceRating; + this.year = year; + this.tagline = tagline; + this.thumb = thumb; + this.art = art; + this.duration = duration; + this.originallyAvailableAt = originallyAvailableAt; + this.addedAt = addedAt; + this.updatedAt = updatedAt; + this.audienceRatingImage = audienceRatingImage; + this.chapterSource = chapterSource; + this.primaryExtraKey = primaryExtraKey; + this.ratingImage = ratingImage; + this.media = media; + this.genre = genre; + this.director = director; + this.writer = writer; + this.country = country; + this.role = role; + } + + public GetRecentlyAddedMetadata() { + 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()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionUUID() { + return (Optional) librarySectionUUID; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional studio() { + return (Optional) studio; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional contentRating() { + return (Optional) contentRating; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional rating() { + return (Optional) rating; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRating() { + return (Optional) audienceRating; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional year() { + return (Optional) year; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagline() { + return (Optional) tagline; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originallyAvailableAt() { + return (Optional) originallyAvailableAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRatingImage() { + return (Optional) audienceRatingImage; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional chapterSource() { + return (Optional) chapterSource; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional primaryExtraKey() { + return (Optional) primaryExtraKey; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingImage() { + return (Optional) ratingImage; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> media() { + return (Optional>) media; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> genre() { + return (Optional>) genre; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> director() { + return (Optional>) director; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> writer() { + return (Optional>) writer; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> country() { + return (Optional>) country; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> role() { + return (Optional>) role; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetRecentlyAddedMetadata withAllowSync(boolean allowSync) { + Utils.checkNotNull(allowSync, "allowSync"); + this.allowSync = Optional.ofNullable(allowSync); + return this; + } + + public GetRecentlyAddedMetadata withAllowSync(Optional allowSync) { + Utils.checkNotNull(allowSync, "allowSync"); + this.allowSync = allowSync; + return this; + } + + public GetRecentlyAddedMetadata withLibrarySectionID(double librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = Optional.ofNullable(librarySectionID); + return this; + } + + public GetRecentlyAddedMetadata withLibrarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + public GetRecentlyAddedMetadata withLibrarySectionTitle(String librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); + return this; + } + + public GetRecentlyAddedMetadata withLibrarySectionTitle(Optional librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = librarySectionTitle; + return this; + } + + public GetRecentlyAddedMetadata withLibrarySectionUUID(String librarySectionUUID) { + Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); + this.librarySectionUUID = Optional.ofNullable(librarySectionUUID); + return this; + } + + public GetRecentlyAddedMetadata withLibrarySectionUUID(Optional librarySectionUUID) { + Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); + this.librarySectionUUID = librarySectionUUID; + return this; + } + + public GetRecentlyAddedMetadata withRatingKey(double ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = Optional.ofNullable(ratingKey); + return this; + } + + public GetRecentlyAddedMetadata withRatingKey(Optional ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + public GetRecentlyAddedMetadata withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = Optional.ofNullable(key); + return this; + } + + public GetRecentlyAddedMetadata withKey(Optional key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetRecentlyAddedMetadata withGuid(String guid) { + Utils.checkNotNull(guid, "guid"); + this.guid = Optional.ofNullable(guid); + return this; + } + + public GetRecentlyAddedMetadata withGuid(Optional guid) { + Utils.checkNotNull(guid, "guid"); + this.guid = guid; + return this; + } + + public GetRecentlyAddedMetadata withStudio(String studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = Optional.ofNullable(studio); + return this; + } + + public GetRecentlyAddedMetadata withStudio(Optional studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = studio; + return this; + } + + public GetRecentlyAddedMetadata withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + public GetRecentlyAddedMetadata withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetRecentlyAddedMetadata withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.ofNullable(title); + return this; + } + + public GetRecentlyAddedMetadata withTitle(Optional title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public GetRecentlyAddedMetadata withContentRating(String contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = Optional.ofNullable(contentRating); + return this; + } + + public GetRecentlyAddedMetadata withContentRating(Optional contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = contentRating; + return this; + } + + public GetRecentlyAddedMetadata withSummary(String summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = Optional.ofNullable(summary); + return this; + } + + public GetRecentlyAddedMetadata withSummary(Optional summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = summary; + return this; + } + + public GetRecentlyAddedMetadata withRating(double rating) { + Utils.checkNotNull(rating, "rating"); + this.rating = Optional.ofNullable(rating); + return this; + } + + public GetRecentlyAddedMetadata withRating(Optional rating) { + Utils.checkNotNull(rating, "rating"); + this.rating = rating; + return this; + } + + public GetRecentlyAddedMetadata withAudienceRating(double audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = Optional.ofNullable(audienceRating); + return this; + } + + public GetRecentlyAddedMetadata withAudienceRating(Optional audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = audienceRating; + return this; + } + + public GetRecentlyAddedMetadata withYear(double year) { + Utils.checkNotNull(year, "year"); + this.year = Optional.ofNullable(year); + return this; + } + + public GetRecentlyAddedMetadata withYear(Optional year) { + Utils.checkNotNull(year, "year"); + this.year = year; + return this; + } + + public GetRecentlyAddedMetadata withTagline(String tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = Optional.ofNullable(tagline); + return this; + } + + public GetRecentlyAddedMetadata withTagline(Optional tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = tagline; + return this; + } + + public GetRecentlyAddedMetadata withThumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public GetRecentlyAddedMetadata withThumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public GetRecentlyAddedMetadata withArt(String art) { + Utils.checkNotNull(art, "art"); + this.art = Optional.ofNullable(art); + return this; + } + + public GetRecentlyAddedMetadata withArt(Optional art) { + Utils.checkNotNull(art, "art"); + this.art = art; + return this; + } + + public GetRecentlyAddedMetadata withDuration(double duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public GetRecentlyAddedMetadata withDuration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public GetRecentlyAddedMetadata withOriginallyAvailableAt(OffsetDateTime originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); + return this; + } + + public GetRecentlyAddedMetadata withOriginallyAvailableAt(Optional originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = originallyAvailableAt; + return this; + } + + public GetRecentlyAddedMetadata withAddedAt(double addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = Optional.ofNullable(addedAt); + return this; + } + + public GetRecentlyAddedMetadata withAddedAt(Optional addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = addedAt; + return this; + } + + public GetRecentlyAddedMetadata withUpdatedAt(double updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public GetRecentlyAddedMetadata withUpdatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public GetRecentlyAddedMetadata withAudienceRatingImage(String audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); + return this; + } + + public GetRecentlyAddedMetadata withAudienceRatingImage(Optional audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = audienceRatingImage; + return this; + } + + public GetRecentlyAddedMetadata withChapterSource(String chapterSource) { + Utils.checkNotNull(chapterSource, "chapterSource"); + this.chapterSource = Optional.ofNullable(chapterSource); + return this; + } + + public GetRecentlyAddedMetadata withChapterSource(Optional chapterSource) { + Utils.checkNotNull(chapterSource, "chapterSource"); + this.chapterSource = chapterSource; + return this; + } + + public GetRecentlyAddedMetadata withPrimaryExtraKey(String primaryExtraKey) { + Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); + this.primaryExtraKey = Optional.ofNullable(primaryExtraKey); + return this; + } + + public GetRecentlyAddedMetadata withPrimaryExtraKey(Optional primaryExtraKey) { + Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); + this.primaryExtraKey = primaryExtraKey; + return this; + } + + public GetRecentlyAddedMetadata withRatingImage(String ratingImage) { + Utils.checkNotNull(ratingImage, "ratingImage"); + this.ratingImage = Optional.ofNullable(ratingImage); + return this; + } + + public GetRecentlyAddedMetadata withRatingImage(Optional ratingImage) { + Utils.checkNotNull(ratingImage, "ratingImage"); + this.ratingImage = ratingImage; + return this; + } + + public GetRecentlyAddedMetadata withMedia(java.util.List media) { + Utils.checkNotNull(media, "media"); + this.media = Optional.ofNullable(media); + return this; + } + + public GetRecentlyAddedMetadata withMedia(Optional> media) { + Utils.checkNotNull(media, "media"); + this.media = media; + return this; + } + + public GetRecentlyAddedMetadata withGenre(java.util.List genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = Optional.ofNullable(genre); + return this; + } + + public GetRecentlyAddedMetadata withGenre(Optional> genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = genre; + return this; + } + + public GetRecentlyAddedMetadata withDirector(java.util.List director) { + Utils.checkNotNull(director, "director"); + this.director = Optional.ofNullable(director); + return this; + } + + public GetRecentlyAddedMetadata withDirector(Optional> director) { + Utils.checkNotNull(director, "director"); + this.director = director; + return this; + } + + public GetRecentlyAddedMetadata withWriter(java.util.List writer) { + Utils.checkNotNull(writer, "writer"); + this.writer = Optional.ofNullable(writer); + return this; + } + + public GetRecentlyAddedMetadata withWriter(Optional> writer) { + Utils.checkNotNull(writer, "writer"); + this.writer = writer; + return this; + } + + public GetRecentlyAddedMetadata withCountry(java.util.List country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + public GetRecentlyAddedMetadata withCountry(Optional> country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + public GetRecentlyAddedMetadata withRole(java.util.List role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public GetRecentlyAddedMetadata withRole(Optional> role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRecentlyAddedMetadata other = (GetRecentlyAddedMetadata) o; + return + java.util.Objects.deepEquals(this.allowSync, other.allowSync) && + java.util.Objects.deepEquals(this.librarySectionID, other.librarySectionID) && + java.util.Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && + java.util.Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) && + java.util.Objects.deepEquals(this.ratingKey, other.ratingKey) && + java.util.Objects.deepEquals(this.key, other.key) && + java.util.Objects.deepEquals(this.guid, other.guid) && + java.util.Objects.deepEquals(this.studio, other.studio) && + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.title, other.title) && + java.util.Objects.deepEquals(this.contentRating, other.contentRating) && + java.util.Objects.deepEquals(this.summary, other.summary) && + java.util.Objects.deepEquals(this.rating, other.rating) && + java.util.Objects.deepEquals(this.audienceRating, other.audienceRating) && + java.util.Objects.deepEquals(this.year, other.year) && + java.util.Objects.deepEquals(this.tagline, other.tagline) && + java.util.Objects.deepEquals(this.thumb, other.thumb) && + java.util.Objects.deepEquals(this.art, other.art) && + java.util.Objects.deepEquals(this.duration, other.duration) && + java.util.Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + java.util.Objects.deepEquals(this.addedAt, other.addedAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt) && + java.util.Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && + java.util.Objects.deepEquals(this.chapterSource, other.chapterSource) && + java.util.Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && + java.util.Objects.deepEquals(this.ratingImage, other.ratingImage) && + java.util.Objects.deepEquals(this.media, other.media) && + java.util.Objects.deepEquals(this.genre, other.genre) && + java.util.Objects.deepEquals(this.director, other.director) && + java.util.Objects.deepEquals(this.writer, other.writer) && + java.util.Objects.deepEquals(this.country, other.country) && + java.util.Objects.deepEquals(this.role, other.role); + } + + @Override + public int hashCode() { + return java.util.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); + } + + @Override + public String toString() { + return Utils.toString(GetRecentlyAddedMetadata.class, + "allowSync", allowSync, + "librarySectionID", librarySectionID, + "librarySectionTitle", librarySectionTitle, + "librarySectionUUID", librarySectionUUID, + "ratingKey", ratingKey, + "key", key, + "guid", guid, + "studio", studio, + "type", type, + "title", title, + "contentRating", contentRating, + "summary", summary, + "rating", rating, + "audienceRating", audienceRating, + "year", year, + "tagline", tagline, + "thumb", thumb, + "art", art, + "duration", duration, + "originallyAvailableAt", originallyAvailableAt, + "addedAt", addedAt, + "updatedAt", updatedAt, + "audienceRatingImage", audienceRatingImage, + "chapterSource", chapterSource, + "primaryExtraKey", primaryExtraKey, + "ratingImage", ratingImage, + "media", media, + "genre", genre, + "director", director, + "writer", writer, + "country", country, + "role", role); + } + + 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); + return this; + } + + public Builder allowSync(Optional allowSync) { + Utils.checkNotNull(allowSync, "allowSync"); + this.allowSync = allowSync; + return this; + } + + public Builder librarySectionID(double librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = Optional.ofNullable(librarySectionID); + return this; + } + + public Builder librarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + public Builder librarySectionTitle(String librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); + return this; + } + + public Builder librarySectionTitle(Optional librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = librarySectionTitle; + return this; + } + + public Builder librarySectionUUID(String librarySectionUUID) { + Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); + this.librarySectionUUID = Optional.ofNullable(librarySectionUUID); + return this; + } + + public Builder librarySectionUUID(Optional librarySectionUUID) { + Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); + this.librarySectionUUID = librarySectionUUID; + return this; + } + + public Builder ratingKey(double ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = Optional.ofNullable(ratingKey); + return this; + } + + public Builder ratingKey(Optional ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = Optional.ofNullable(key); + return this; + } + + public Builder key(Optional key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder guid(String guid) { + Utils.checkNotNull(guid, "guid"); + this.guid = Optional.ofNullable(guid); + return this; + } + + public Builder guid(Optional guid) { + Utils.checkNotNull(guid, "guid"); + this.guid = guid; + return this; + } + + public Builder studio(String studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = Optional.ofNullable(studio); + return this; + } + + public Builder studio(Optional studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = studio; + return this; + } + + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.ofNullable(title); + return this; + } + + public Builder title(Optional title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public Builder contentRating(String contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = Optional.ofNullable(contentRating); + return this; + } + + public Builder contentRating(Optional contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = contentRating; + return this; + } + + public Builder summary(String summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = Optional.ofNullable(summary); + return this; + } + + public Builder summary(Optional summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = summary; + return this; + } + + public Builder rating(double rating) { + Utils.checkNotNull(rating, "rating"); + this.rating = Optional.ofNullable(rating); + return this; + } + + public Builder rating(Optional rating) { + Utils.checkNotNull(rating, "rating"); + this.rating = rating; + return this; + } + + public Builder audienceRating(double audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = Optional.ofNullable(audienceRating); + return this; + } + + public Builder audienceRating(Optional audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = audienceRating; + return this; + } + + public Builder year(double year) { + Utils.checkNotNull(year, "year"); + this.year = Optional.ofNullable(year); + return this; + } + + public Builder year(Optional year) { + Utils.checkNotNull(year, "year"); + this.year = year; + return this; + } + + public Builder tagline(String tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = Optional.ofNullable(tagline); + return this; + } + + public Builder tagline(Optional tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = tagline; + return this; + } + + public Builder thumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public Builder thumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public Builder art(String art) { + Utils.checkNotNull(art, "art"); + this.art = Optional.ofNullable(art); + return this; + } + + public Builder art(Optional art) { + Utils.checkNotNull(art, "art"); + this.art = art; + return this; + } + + public Builder duration(double duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Builder duration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public Builder originallyAvailableAt(OffsetDateTime originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); + return this; + } + + public Builder originallyAvailableAt(Optional originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = originallyAvailableAt; + return this; + } + + public Builder addedAt(double addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = Optional.ofNullable(addedAt); + return this; + } + + public Builder addedAt(Optional addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = addedAt; + return this; + } + + public Builder updatedAt(double updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public Builder updatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public Builder audienceRatingImage(String audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); + return this; + } + + public Builder audienceRatingImage(Optional audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = audienceRatingImage; + return this; + } + + public Builder chapterSource(String chapterSource) { + Utils.checkNotNull(chapterSource, "chapterSource"); + this.chapterSource = Optional.ofNullable(chapterSource); + return this; + } + + public Builder chapterSource(Optional chapterSource) { + Utils.checkNotNull(chapterSource, "chapterSource"); + this.chapterSource = chapterSource; + return this; + } + + public Builder primaryExtraKey(String primaryExtraKey) { + Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); + this.primaryExtraKey = Optional.ofNullable(primaryExtraKey); + return this; + } + + public Builder primaryExtraKey(Optional primaryExtraKey) { + Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); + this.primaryExtraKey = primaryExtraKey; + return this; + } + + public Builder ratingImage(String ratingImage) { + Utils.checkNotNull(ratingImage, "ratingImage"); + this.ratingImage = Optional.ofNullable(ratingImage); + return this; + } + + public Builder ratingImage(Optional ratingImage) { + Utils.checkNotNull(ratingImage, "ratingImage"); + this.ratingImage = ratingImage; + return this; + } + + public Builder media(java.util.List media) { + Utils.checkNotNull(media, "media"); + this.media = Optional.ofNullable(media); + return this; + } + + public Builder media(Optional> media) { + Utils.checkNotNull(media, "media"); + this.media = media; + return this; + } + + public Builder genre(java.util.List genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = Optional.ofNullable(genre); + return this; + } + + public Builder genre(Optional> genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = genre; + return this; + } + + public Builder director(java.util.List director) { + Utils.checkNotNull(director, "director"); + this.director = Optional.ofNullable(director); + return this; + } + + public Builder director(Optional> director) { + Utils.checkNotNull(director, "director"); + this.director = director; + return this; + } + + public Builder writer(java.util.List writer) { + Utils.checkNotNull(writer, "writer"); + this.writer = Optional.ofNullable(writer); + return this; + } + + public Builder writer(Optional> writer) { + Utils.checkNotNull(writer, "writer"); + this.writer = writer; + return this; + } + + public Builder country(java.util.List country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + public Builder country(Optional> country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + public Builder role(java.util.List role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public Builder role(Optional> role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public GetRecentlyAddedMetadata build() { + return new GetRecentlyAddedMetadata( + 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/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedResponse.java index af98bc8b..15cf3cc9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils /** * The recently added content */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetRecentlyAddedResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils /** * The recently added content */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils /** * The recently added content */ - public GetRecentlyAddedResponse withTwoHundredApplicationJsonObject(GetRecentlyAddedResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetRecentlyAddedResponse withObject(GetRecentlyAddedResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The recently added content */ - public GetRecentlyAddedResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetRecentlyAddedResponse withFourHundredAndOneApplicationJsonObject(GetRecentlyAddedLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetRecentlyAddedResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetRecentlyAddedResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils /** * The recently added content */ - public Builder twoHundredApplicationJsonObject(GetRecentlyAddedResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetRecentlyAddedResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The recently added content */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetRecentlyAddedLibraryResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetRecentlyAddedResponse implements lukehagar.plexapi.plexapi.utils contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedResponseBody.java index 38878077..0d55be0b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetRecentlyAddedResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetRecentlyAddedResponseBody - The recently added content */ @@ -26,14 +27,21 @@ public class GetRecentlyAddedResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetRecentlyAddedResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetRecentlyAddedResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoRequest.java index ce7b6665..0c423080 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import lukehagar.plexapi.plexapi.utils.LazySingletonValue; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetResizedPhotoRequest { /** @@ -59,6 +60,7 @@ public class GetResizedPhotoRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=url") private String url; + @JsonCreator public GetResizedPhotoRequest( double width, double height, @@ -86,6 +88,7 @@ public class GetResizedPhotoRequest { /** * The width for the resized photo */ + @JsonIgnore public double width() { return width; } @@ -93,6 +96,7 @@ public class GetResizedPhotoRequest { /** * The height for the resized photo */ + @JsonIgnore public double height() { return height; } @@ -100,6 +104,7 @@ public class GetResizedPhotoRequest { /** * The opacity for the resized photo */ + @JsonIgnore public long opacity() { return opacity; } @@ -107,6 +112,7 @@ public class GetResizedPhotoRequest { /** * The width for the resized photo */ + @JsonIgnore public double blur() { return blur; } @@ -114,6 +120,7 @@ public class GetResizedPhotoRequest { /** * images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. */ + @JsonIgnore public MinSize minSize() { return minSize; } @@ -121,6 +128,7 @@ public class GetResizedPhotoRequest { /** * allow images to be resized beyond native dimensions. */ + @JsonIgnore public Upscale upscale() { return upscale; } @@ -128,6 +136,7 @@ public class GetResizedPhotoRequest { /** * path to image within Plex */ + @JsonIgnore public String url() { return url; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoResponse.java index 67bca734..784577d2 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResizedPhotoResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetResizedPhotoResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class GetResizedPhotoResponse implements lukehagar.plexapi.plexapi.utils. */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public GetResizedPhotoResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class GetResizedPhotoResponse implements lukehagar.plexapi.plexapi.utils. /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class GetResizedPhotoResponse implements lukehagar.plexapi.plexapi.utils. /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class GetResizedPhotoResponse implements lukehagar.plexapi.plexapi.utils. this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetResizedPhotoResponse withObject(GetResizedPhotoResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetResizedPhotoResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class GetResizedPhotoResponse implements lukehagar.plexapi.plexapi.utils. return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class GetResizedPhotoResponse implements lukehagar.plexapi.plexapi.utils. return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class GetResizedPhotoResponse implements lukehagar.plexapi.plexapi.utils. return Utils.toString(GetResizedPhotoResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class GetResizedPhotoResponse implements lukehagar.plexapi.plexapi.utils. private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class GetResizedPhotoResponse implements lukehagar.plexapi.plexapi.utils. this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(GetResizedPhotoResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public GetResizedPhotoResponse build() { return new GetResizedPhotoResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsMediaContainer.java new file mode 100644 index 00000000..61ce8acf --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsMediaContainer.java @@ -0,0 +1,154 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetResourcesStatisticsMediaContainer { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("size") + private Optional size; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("StatisticsResources") + private Optional> statisticsResources; + + @JsonCreator + public GetResourcesStatisticsMediaContainer( + @JsonProperty("size") Optional size, + @JsonProperty("StatisticsResources") Optional> statisticsResources) { + Utils.checkNotNull(size, "size"); + Utils.checkNotNull(statisticsResources, "statisticsResources"); + this.size = size; + this.statisticsResources = statisticsResources; + } + + public GetResourcesStatisticsMediaContainer() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> statisticsResources() { + return (Optional>) statisticsResources; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetResourcesStatisticsMediaContainer withSize(int size) { + Utils.checkNotNull(size, "size"); + this.size = Optional.ofNullable(size); + return this; + } + + public GetResourcesStatisticsMediaContainer withSize(Optional size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + public GetResourcesStatisticsMediaContainer withStatisticsResources(java.util.List statisticsResources) { + Utils.checkNotNull(statisticsResources, "statisticsResources"); + this.statisticsResources = Optional.ofNullable(statisticsResources); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResourcesStatisticsMediaContainer other = (GetResourcesStatisticsMediaContainer) o; + return + java.util.Objects.deepEquals(this.size, other.size) && + java.util.Objects.deepEquals(this.statisticsResources, other.statisticsResources); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + size, + statisticsResources); + } + + @Override + public String toString() { + return Utils.toString(GetResourcesStatisticsMediaContainer.class, + "size", size, + "statisticsResources", statisticsResources); + } + + 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); + return this; + } + + public Builder size(Optional size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + public Builder statisticsResources(java.util.List statisticsResources) { + Utils.checkNotNull(statisticsResources, "statisticsResources"); + this.statisticsResources = Optional.ofNullable(statisticsResources); + return this; + } + + public Builder statisticsResources(Optional> statisticsResources) { + Utils.checkNotNull(statisticsResources, "statisticsResources"); + this.statisticsResources = statisticsResources; + return this; + } + + public GetResourcesStatisticsMediaContainer build() { + return new GetResourcesStatisticsMediaContainer( + size, + statisticsResources); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsRequest.java new file mode 100644 index 00000000..555255a8 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsRequest.java @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetResourcesStatisticsRequest { + + /** + * The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=Timespan") + private Optional timespan; + + @JsonCreator + public GetResourcesStatisticsRequest( + Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + } + + public GetResourcesStatisticsRequest() { + this(Optional.empty()); + } + + /** + * The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional timespan() { + return (Optional) timespan; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + */ + public GetResourcesStatisticsRequest withTimespan(long timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = Optional.ofNullable(timespan); + return this; + } + + /** + * The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + */ + public GetResourcesStatisticsRequest withTimespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResourcesStatisticsRequest other = (GetResourcesStatisticsRequest) o; + return + java.util.Objects.deepEquals(this.timespan, other.timespan); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + timespan); + } + + @Override + public String toString() { + return Utils.toString(GetResourcesStatisticsRequest.class, + "timespan", timespan); + } + + 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 + * + */ + public Builder timespan(long timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = Optional.ofNullable(timespan); + return this; + } + + /** + * The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + */ + public Builder timespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + public GetResourcesStatisticsRequest build() { + return new GetResourcesStatisticsRequest( + timespan); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsRequestBuilder.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsRequestBuilder.java new file mode 100644 index 00000000..9c2dd3f1 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import lukehagar.plexapi.plexapi.models.errors.SDKError; +import lukehagar.plexapi.plexapi.utils.LazySingletonValue; +import lukehagar.plexapi.plexapi.utils.Utils; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetResourcesStatisticsRequestBuilder { + + private Optional timespan = Optional.empty(); + private final SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk; + + public GetResourcesStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk) { + this.sdk = sdk; + } + + 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; + } + + public GetResourcesStatisticsResponse call() throws Exception { + + return sdk.getResourcesStatistics( + timespan); + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsResponse.java new file mode 100644 index 00000000..3b52c095 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetResourcesStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * 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 final 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 + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetResourcesStatisticsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * 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/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsResponseBody.java new file mode 100644 index 00000000..7f34f154 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetResourcesStatisticsResponseBody.java @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; +/** + * GetResourcesStatisticsResponseBody - Resource Statistics + */ + +public class GetResourcesStatisticsResponseBody { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("MediaContainer") + private Optional mediaContainer; + + @JsonCreator + public GetResourcesStatisticsResponseBody( + @JsonProperty("MediaContainer") Optional mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = mediaContainer; + } + + public GetResourcesStatisticsResponseBody() { + this(Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetResourcesStatisticsResponseBody withMediaContainer(GetResourcesStatisticsMediaContainer mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = Optional.ofNullable(mediaContainer); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResourcesStatisticsResponseBody other = (GetResourcesStatisticsResponseBody) o; + return + java.util.Objects.deepEquals(this.mediaContainer, other.mediaContainer); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + mediaContainer); + } + + @Override + public String toString() { + return Utils.toString(GetResourcesStatisticsResponseBody.class, + "mediaContainer", mediaContainer); + } + + 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); + return this; + } + + public Builder mediaContainer(Optional mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = mediaContainer; + return this; + } + + public GetResourcesStatisticsResponseBody build() { + return new GetResourcesStatisticsResponseBody( + mediaContainer); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsCountry.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsCountry.java index f3af53dd..419f38d9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsCountry.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsCountry.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsCountry { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetSearchResultsCountry( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetSearchResultsCountry() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsDirector.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsDirector.java index 446f5f07..58b32ad8 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsDirector.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsDirector.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsDirector { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetSearchResultsDirector( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetSearchResultsDirector() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsGenre.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsGenre.java index de7878d7..fb878211 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsGenre.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsGenre.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsGenre { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetSearchResultsGenre( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetSearchResultsGenre() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMedia.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMedia.java index 0e5fc295..0fc2b14a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMedia.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMedia.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsMedia { @JsonInclude(Include.NON_ABSENT) @@ -79,6 +80,7 @@ public class GetSearchResultsMedia { @JsonProperty("Part") private Optional> part; + @JsonCreator public GetSearchResultsMedia( @JsonProperty("id") Optional id, @JsonProperty("duration") Optional duration, @@ -126,65 +128,99 @@ public class GetSearchResultsMedia { this.videoProfile = videoProfile; this.part = part; } - - public Optional id() { - return id; + + 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()); } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional width() { - return width; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional height() { - return height; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional width() { + return (Optional) width; } - public Optional aspectRatio() { - return aspectRatio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional height() { + return (Optional) height; } - public Optional audioChannels() { - return audioChannels; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional aspectRatio() { + return (Optional) aspectRatio; } - public Optional audioCodec() { - return audioCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioChannels() { + return (Optional) audioChannels; } - public Optional videoCodec() { - return videoCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioCodec() { + return (Optional) audioCodec; } - public Optional videoResolution() { - return videoResolution; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoCodec() { + return (Optional) videoCodec; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoResolution() { + return (Optional) videoResolution; } - public Optional videoFrameRate() { - return videoFrameRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional audioProfile() { - return audioProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoFrameRate() { + return (Optional) videoFrameRate; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioProfile() { + return (Optional) audioProfile; } - public Optional> part() { - return part; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> part() { + return (Optional>) part; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMediaContainer.java index 374a86e2..8999b531 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -43,6 +44,7 @@ public class GetSearchResultsMediaContainer { @JsonProperty("Provider") private Optional> provider; + @JsonCreator public GetSearchResultsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("identifier") Optional identifier, @@ -63,29 +65,45 @@ public class GetSearchResultsMediaContainer { this.metadata = metadata; this.provider = provider; } - - public Optional size() { - return size; + + public GetSearchResultsMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional mediaTagPrefix() { - return mediaTagPrefix; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; } - public Optional mediaTagVersion() { - return mediaTagVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagPrefix() { + return (Optional) mediaTagPrefix; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagVersion() { + return (Optional) mediaTagVersion; } - public Optional> provider() { - return provider; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> provider() { + return (Optional>) provider; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMetadata.java index ae488473..8a14ba23 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -19,7 +21,6 @@ import java.time.OffsetDateTime; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsMetadata { @JsonInclude(Include.NON_ABSENT) @@ -158,6 +159,7 @@ public class GetSearchResultsMetadata { @JsonProperty("Role") private Optional> role; + @JsonCreator public GetSearchResultsMetadata( @JsonProperty("allowSync") Optional allowSync, @JsonProperty("librarySectionID") Optional librarySectionID, @@ -262,141 +264,213 @@ public class GetSearchResultsMetadata { this.country = country; this.role = role; } - - public Optional allowSync() { - return allowSync; + + 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()); } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional librarySectionUUID() { - return librarySectionUUID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; } - public Optional personal() { - return personal; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionUUID() { + return (Optional) librarySectionUUID; } - public Optional sourceTitle() { - return sourceTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional personal() { + return (Optional) personal; } - public Optional ratingKey() { - return ratingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sourceTitle() { + return (Optional) sourceTitle; } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional studio() { - return studio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional studio() { + return (Optional) studio; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional contentRating() { - return contentRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional contentRating() { + return (Optional) contentRating; } - public Optional rating() { - return rating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional audienceRating() { - return audienceRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional rating() { + return (Optional) rating; } - public Optional year() { - return year; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRating() { + return (Optional) audienceRating; } - public Optional tagline() { - return tagline; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional year() { + return (Optional) year; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagline() { + return (Optional) tagline; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional originallyAvailableAt() { - return originallyAvailableAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originallyAvailableAt() { + return (Optional) originallyAvailableAt; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; } - public Optional audienceRatingImage() { - return audienceRatingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional chapterSource() { - return chapterSource; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRatingImage() { + return (Optional) audienceRatingImage; } - public Optional primaryExtraKey() { - return primaryExtraKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional chapterSource() { + return (Optional) chapterSource; } - public Optional ratingImage() { - return ratingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional primaryExtraKey() { + return (Optional) primaryExtraKey; } - public Optional> media() { - return media; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingImage() { + return (Optional) ratingImage; } - public Optional> genre() { - return genre; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> media() { + return (Optional>) media; } - public Optional> director() { - return director; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> genre() { + return (Optional>) genre; } - public Optional> writer() { - return writer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> director() { + return (Optional>) director; } - public Optional> country() { - return country; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> writer() { + return (Optional>) writer; } - public Optional> role() { - return role; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> country() { + return (Optional>) country; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> role() { + return (Optional>) role; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsPart.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsPart.java index 4a956fdd..5cdc853c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsPart.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsPart.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsPart { @JsonInclude(Include.NON_ABSENT) @@ -51,6 +52,7 @@ public class GetSearchResultsPart { @JsonProperty("videoProfile") private Optional videoProfile; + @JsonCreator public GetSearchResultsPart( @JsonProperty("id") Optional id, @JsonProperty("key") Optional key, @@ -77,37 +79,57 @@ public class GetSearchResultsPart { this.container = container; this.videoProfile = videoProfile; } - - public Optional id() { - return id; + + public GetSearchResultsPart() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional file() { - return file; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional file() { + return (Optional) file; } - public Optional audioProfile() { - return audioProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioProfile() { + return (Optional) audioProfile; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsRequest.java index 0e7c6cd2..680e3e4d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsRequest { /** @@ -22,6 +23,7 @@ public class GetSearchResultsRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") private String query; + @JsonCreator public GetSearchResultsRequest( String query) { Utils.checkNotNull(query, "query"); @@ -31,6 +33,7 @@ public class GetSearchResultsRequest { /** * The search query string to use */ + @JsonIgnore public String query() { return query; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsResponse.java index 379f5e4c..b53a1c47 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils /** * Search Results */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetSearchResultsResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils /** * Search Results */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils /** * Search Results */ - public GetSearchResultsResponse withTwoHundredApplicationJsonObject(GetSearchResultsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetSearchResultsResponse withObject(GetSearchResultsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Search Results */ - public GetSearchResultsResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetSearchResultsResponse withFourHundredAndOneApplicationJsonObject(GetSearchResultsSearchResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetSearchResultsResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetSearchResultsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils /** * Search Results */ - public Builder twoHundredApplicationJsonObject(GetSearchResultsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetSearchResultsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Search Results */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetSearchResultsSearchResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetSearchResultsResponse implements lukehagar.plexapi.plexapi.utils contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsResponseBody.java index 2b23237c..d2b2f83a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetSearchResultsResponseBody - Search Results */ @@ -26,14 +27,21 @@ public class GetSearchResultsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetSearchResultsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetSearchResultsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsRole.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsRole.java index e91b23da..7aa870e5 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsRole.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsRole.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsRole { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetSearchResultsRole( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetSearchResultsRole() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsSearchResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsSearchResponseBody.java deleted file mode 100644 index 3529c1e8..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsSearchResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetSearchResultsSearchResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetSearchResultsSearchResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetSearchResultsSearchResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetSearchResultsSearchResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetSearchResultsSearchResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetSearchResultsSearchResponseBody other = (GetSearchResultsSearchResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetSearchResultsSearchResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetSearchResultsSearchResponseBody build() { - return new GetSearchResultsSearchResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsWriter.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsWriter.java index 7d6860a1..74d515e9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsWriter.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSearchResultsWriter.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSearchResultsWriter { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public GetSearchResultsWriter( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public GetSearchResultsWriter() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesActivitiesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesActivitiesResponseBody.java deleted file mode 100644 index 4429b3a9..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesActivitiesResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetServerActivitiesActivitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetServerActivitiesActivitiesResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetServerActivitiesActivitiesResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetServerActivitiesActivitiesResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetServerActivitiesActivitiesResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetServerActivitiesActivitiesResponseBody other = (GetServerActivitiesActivitiesResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetServerActivitiesActivitiesResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetServerActivitiesActivitiesResponseBody build() { - return new GetServerActivitiesActivitiesResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesMediaContainer.java index 778ba48e..247540da 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerActivitiesMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class GetServerActivitiesMediaContainer { @JsonProperty("Activity") private Optional> activity; + @JsonCreator public GetServerActivitiesMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("Activity") Optional> activity) { @@ -35,13 +37,21 @@ public class GetServerActivitiesMediaContainer { this.size = size; this.activity = activity; } - - public Optional size() { - return size; + + public GetServerActivitiesMediaContainer() { + this(Optional.empty(), Optional.empty()); } - public Optional> activity() { - return activity; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> activity() { + return (Optional>) activity; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesResponse.java index b2d13438..c4dd1a2e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut /** * The Server Activities */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetServerActivitiesResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut /** * The Server Activities */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut /** * The Server Activities */ - public GetServerActivitiesResponse withTwoHundredApplicationJsonObject(GetServerActivitiesResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetServerActivitiesResponse withObject(GetServerActivitiesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Server Activities */ - public GetServerActivitiesResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetServerActivitiesResponse withFourHundredAndOneApplicationJsonObject(GetServerActivitiesActivitiesResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetServerActivitiesResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetServerActivitiesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut /** * The Server Activities */ - public Builder twoHundredApplicationJsonObject(GetServerActivitiesResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetServerActivitiesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Server Activities */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetServerActivitiesActivitiesResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetServerActivitiesResponse implements lukehagar.plexapi.plexapi.ut contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesResponseBody.java index 6130acd6..273c3aaa 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerActivitiesResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetServerActivitiesResponseBody - The Server Activities */ @@ -26,14 +27,21 @@ public class GetServerActivitiesResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetServerActivitiesResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetServerActivitiesResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesResponse.java index 6908d9be..c86f2030 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. /** * The Server Capabilities */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetServerCapabilitiesResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. /** * The Server Capabilities */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. /** * The Server Capabilities */ - public GetServerCapabilitiesResponse withTwoHundredApplicationJsonObject(GetServerCapabilitiesResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetServerCapabilitiesResponse withObject(GetServerCapabilitiesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Server Capabilities */ - public GetServerCapabilitiesResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetServerCapabilitiesResponse withFourHundredAndOneApplicationJsonObject(GetServerCapabilitiesServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetServerCapabilitiesResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetServerCapabilitiesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. /** * The Server Capabilities */ - public Builder twoHundredApplicationJsonObject(GetServerCapabilitiesResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetServerCapabilitiesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Server Capabilities */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetServerCapabilitiesServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetServerCapabilitiesResponse implements lukehagar.plexapi.plexapi. contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesResponseBody.java index bf78a33a..c23f83f0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetServerCapabilitiesResponseBody - The Server Capabilities */ @@ -26,14 +27,21 @@ public class GetServerCapabilitiesResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetServerCapabilitiesResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetServerCapabilitiesResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesServerResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesServerResponseBody.java deleted file mode 100644 index 73c59fe5..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerCapabilitiesServerResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetServerCapabilitiesServerResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetServerCapabilitiesServerResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetServerCapabilitiesServerResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetServerCapabilitiesServerResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetServerCapabilitiesServerResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetServerCapabilitiesServerResponseBody other = (GetServerCapabilitiesServerResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetServerCapabilitiesServerResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetServerCapabilitiesServerResponseBody build() { - return new GetServerCapabilitiesServerResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityMediaContainer.java index 657faa9d..fe6cb159 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerIdentityMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -35,6 +36,7 @@ public class GetServerIdentityMediaContainer { @JsonProperty("version") private Optional version; + @JsonCreator public GetServerIdentityMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("claimed") Optional claimed, @@ -49,21 +51,33 @@ public class GetServerIdentityMediaContainer { this.machineIdentifier = machineIdentifier; this.version = version; } - - public Optional size() { - return size; + + public GetServerIdentityMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional claimed() { - return claimed; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional machineIdentifier() { - return machineIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional claimed() { + return (Optional) claimed; } - public Optional version() { - return version; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional machineIdentifier() { + return (Optional) machineIdentifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional version() { + return (Optional) version; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityResponse.java index 5519113f..509dacf9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util /** * The Server Identity information */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetServerIdentityResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util /** * The Server Identity information */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util /** * The Server Identity information */ - public GetServerIdentityResponse withTwoHundredApplicationJsonObject(GetServerIdentityResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetServerIdentityResponse withObject(GetServerIdentityResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Server Identity information */ - public GetServerIdentityResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetServerIdentityResponse withFourHundredAndOneApplicationJsonObject(GetServerIdentityServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetServerIdentityResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetServerIdentityResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util /** * The Server Identity information */ - public Builder twoHundredApplicationJsonObject(GetServerIdentityResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetServerIdentityResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Server Identity information */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetServerIdentityServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetServerIdentityResponse implements lukehagar.plexapi.plexapi.util contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityResponseBody.java index 23686ae3..bb77c300 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetServerIdentityResponseBody - The Server Identity information */ @@ -26,14 +27,21 @@ public class GetServerIdentityResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetServerIdentityResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetServerIdentityResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityServerResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityServerResponseBody.java deleted file mode 100644 index 6242f69a..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerIdentityServerResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetServerIdentityServerResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetServerIdentityServerResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetServerIdentityServerResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetServerIdentityServerResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetServerIdentityServerResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetServerIdentityServerResponseBody other = (GetServerIdentityServerResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetServerIdentityServerResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetServerIdentityServerResponseBody build() { - return new GetServerIdentityServerResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListMediaContainer.java index cf0e2ef9..93cb75f5 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerListMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class GetServerListMediaContainer { @JsonProperty("Server") private Optional> server; + @JsonCreator public GetServerListMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("Server") Optional> server) { @@ -35,13 +37,21 @@ public class GetServerListMediaContainer { this.size = size; this.server = server; } - - public Optional size() { - return size; + + public GetServerListMediaContainer() { + this(Optional.empty(), Optional.empty()); } - public Optional> server() { - return server; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> server() { + return (Optional>) server; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListResponse.java index 0a8c974a..3b3a15c9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re /** * List of Servers */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetServerListResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re /** * List of Servers */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re /** * List of Servers */ - public GetServerListResponse withTwoHundredApplicationJsonObject(GetServerListResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetServerListResponse withObject(GetServerListResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * List of Servers */ - public GetServerListResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetServerListResponse withFourHundredAndOneApplicationJsonObject(GetServerListServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetServerListResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetServerListResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re /** * List of Servers */ - public Builder twoHundredApplicationJsonObject(GetServerListResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetServerListResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * List of Servers */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetServerListServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetServerListResponse implements lukehagar.plexapi.plexapi.utils.Re contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListResponseBody.java index 4ae9372b..fe1ea116 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetServerListResponseBody - List of Servers */ @@ -26,14 +27,21 @@ public class GetServerListResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetServerListResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetServerListResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListServer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListServer.java index 5c099ced..7b00b227 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListServer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListServer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerListServer { @JsonInclude(Include.NON_ABSENT) @@ -43,6 +44,7 @@ public class GetServerListServer { @JsonProperty("version") private Optional version; + @JsonCreator public GetServerListServer( @JsonProperty("name") Optional name, @JsonProperty("host") Optional host, @@ -63,29 +65,45 @@ public class GetServerListServer { this.machineIdentifier = machineIdentifier; this.version = version; } - - public Optional name() { - return name; + + public GetServerListServer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional host() { - return host; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; } - public Optional address() { - return address; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional host() { + return (Optional) host; } - public Optional port() { - return port; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional address() { + return (Optional) address; } - public Optional machineIdentifier() { - return machineIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional port() { + return (Optional) port; } - public Optional version() { - return version; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional machineIdentifier() { + return (Optional) machineIdentifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional version() { + return (Optional) version; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListServerResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListServerResponseBody.java deleted file mode 100644 index 063b5b5b..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerListServerResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetServerListServerResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetServerListServerResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetServerListServerResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetServerListServerResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetServerListServerResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetServerListServerResponseBody other = (GetServerListServerResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetServerListServerResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetServerListServerResponseBody build() { - return new GetServerListServerResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesMediaContainer.java index 5a2ec9fc..eca5b9f2 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerPreferencesMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class GetServerPreferencesMediaContainer { @JsonProperty("Setting") private Optional> setting; + @JsonCreator public GetServerPreferencesMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("Setting") Optional> setting) { @@ -35,13 +37,21 @@ public class GetServerPreferencesMediaContainer { this.size = size; this.setting = setting; } - - public Optional size() { - return size; + + public GetServerPreferencesMediaContainer() { + this(Optional.empty(), Optional.empty()); } - public Optional> setting() { - return setting; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> setting() { + return (Optional>) setting; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesResponse.java index 3ea06ed6..1f81a858 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u /** * Server Preferences */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetServerPreferencesResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u /** * Server Preferences */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u /** * Server Preferences */ - public GetServerPreferencesResponse withTwoHundredApplicationJsonObject(GetServerPreferencesResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetServerPreferencesResponse withObject(GetServerPreferencesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Server Preferences */ - public GetServerPreferencesResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetServerPreferencesResponse withFourHundredAndOneApplicationJsonObject(GetServerPreferencesServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetServerPreferencesResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetServerPreferencesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u /** * Server Preferences */ - public Builder twoHundredApplicationJsonObject(GetServerPreferencesResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetServerPreferencesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Server Preferences */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetServerPreferencesServerResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetServerPreferencesResponse implements lukehagar.plexapi.plexapi.u contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesResponseBody.java index 2457cb02..68236846 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetServerPreferencesResponseBody - Server Preferences */ @@ -26,14 +27,21 @@ public class GetServerPreferencesResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetServerPreferencesResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetServerPreferencesResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesServerResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesServerResponseBody.java deleted file mode 100644 index 6c404f60..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetServerPreferencesServerResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetServerPreferencesServerResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetServerPreferencesServerResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetServerPreferencesServerResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetServerPreferencesServerResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetServerPreferencesServerResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetServerPreferencesServerResponseBody other = (GetServerPreferencesServerResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetServerPreferencesServerResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetServerPreferencesServerResponseBody build() { - return new GetServerPreferencesServerResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryMediaContainer.java index c0e967e5..dc38fde0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionHistoryMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class GetSessionHistoryMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public GetSessionHistoryMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("Metadata") Optional> metadata) { @@ -35,13 +37,21 @@ public class GetSessionHistoryMediaContainer { this.size = size; this.metadata = metadata; } - - public Optional size() { - return size; + + public GetSessionHistoryMediaContainer() { + this(Optional.empty(), Optional.empty()); } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryMetadata.java index 426c2dc6..ce883a15 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -17,7 +19,6 @@ import java.time.LocalDate; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionHistoryMetadata { @JsonInclude(Include.NON_ABSENT) @@ -96,6 +97,7 @@ public class GetSessionHistoryMetadata { @JsonProperty("deviceID") private Optional deviceID; + @JsonCreator public GetSessionHistoryMetadata( @JsonProperty("historyKey") Optional historyKey, @JsonProperty("key") Optional key, @@ -155,81 +157,123 @@ public class GetSessionHistoryMetadata { this.accountID = accountID; this.deviceID = deviceID; } - - public Optional historyKey() { - return historyKey; + + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional historyKey() { + return (Optional) historyKey; } - public Optional ratingKey() { - return ratingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional parentKey() { - return parentKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional grandparentKey() { - return grandparentKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentKey() { + return (Optional) parentKey; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentKey() { + return (Optional) grandparentKey; } - public Optional grandparentTitle() { - return grandparentTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentTitle() { + return (Optional) grandparentTitle; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional parentThumb() { - return parentThumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional grandparentThumb() { - return grandparentThumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentThumb() { + return (Optional) parentThumb; } - public Optional grandparentArt() { - return grandparentArt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentThumb() { + return (Optional) grandparentThumb; } - public Optional index() { - return index; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentArt() { + return (Optional) grandparentArt; } - public Optional parentIndex() { - return parentIndex; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional index() { + return (Optional) index; } - public Optional originallyAvailableAt() { - return originallyAvailableAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentIndex() { + return (Optional) parentIndex; } - public Optional viewedAt() { - return viewedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originallyAvailableAt() { + return (Optional) originallyAvailableAt; } - public Optional accountID() { - return accountID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewedAt() { + return (Optional) viewedAt; } - public Optional deviceID() { - return deviceID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional accountID() { + return (Optional) accountID; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deviceID() { + return (Optional) deviceID; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryRequest.java new file mode 100644 index 00000000..34725b22 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryRequest.java @@ -0,0 +1,336 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetSessionHistoryRequest { + + /** + * Sorts the results by the specified field followed by the direction (asc, desc) + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=sort") + private Optional sort; + + /** + * Filter results by those that are related to a specific users id + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=accountId") + private Optional accountId; + + /** + * Filters content by field and direction/equality + * (Unknown if viewedAt is the only supported column) + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=filter") + private Optional filter; + + /** + * Filters the results based on the id of a valid library section + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=librarySectionID") + private Optional librarySectionID; + + @JsonCreator + public GetSessionHistoryRequest( + Optional sort, + Optional accountId, + Optional filter, + Optional librarySectionID) { + Utils.checkNotNull(sort, "sort"); + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(filter, "filter"); + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.sort = sort; + this.accountId = accountId; + this.filter = filter; + this.librarySectionID = librarySectionID; + } + + public GetSessionHistoryRequest() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * Sorts the results by the specified field followed by the direction (asc, desc) + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sort() { + return (Optional) sort; + } + + /** + * Filter results by those that are related to a specific users id + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional accountId() { + return (Optional) accountId; + } + + /** + * Filters content by field and direction/equality + * (Unknown if viewedAt is the only supported column) + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; + } + + /** + * Filters the results based on the id of a valid library section + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Sorts the results by the specified field followed by the direction (asc, desc) + * + */ + public GetSessionHistoryRequest withSort(String sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = Optional.ofNullable(sort); + return this; + } + + /** + * Sorts the results by the specified field followed by the direction (asc, desc) + * + */ + public GetSessionHistoryRequest withSort(Optional sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = sort; + return this; + } + + /** + * Filter results by those that are related to a specific users id + * + */ + public GetSessionHistoryRequest withAccountId(long accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.ofNullable(accountId); + return this; + } + + /** + * Filter results by those that are related to a specific users id + * + */ + public GetSessionHistoryRequest withAccountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Filters content by field and direction/equality + * (Unknown if viewedAt is the only supported column) + * + */ + public GetSessionHistoryRequest withFilter(Filter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + /** + * Filters content by field and direction/equality + * (Unknown if viewedAt is the only supported column) + * + */ + public GetSessionHistoryRequest withFilter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + /** + * Filters the results based on the id of a valid library section + * + */ + public GetSessionHistoryRequest withLibrarySectionID(long librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = Optional.ofNullable(librarySectionID); + return this; + } + + /** + * Filters the results based on the id of a valid library section + * + */ + public GetSessionHistoryRequest withLibrarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionHistoryRequest other = (GetSessionHistoryRequest) o; + return + java.util.Objects.deepEquals(this.sort, other.sort) && + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.filter, other.filter) && + java.util.Objects.deepEquals(this.librarySectionID, other.librarySectionID); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + sort, + accountId, + filter, + librarySectionID); + } + + @Override + public String toString() { + return Utils.toString(GetSessionHistoryRequest.class, + "sort", sort, + "accountId", accountId, + "filter", filter, + "librarySectionID", librarySectionID); + } + + 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) + * + */ + public Builder sort(String sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = Optional.ofNullable(sort); + return this; + } + + /** + * Sorts the results by the specified field followed by the direction (asc, desc) + * + */ + public Builder sort(Optional sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = sort; + return this; + } + + /** + * Filter results by those that are related to a specific users id + * + */ + public Builder accountId(long accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.ofNullable(accountId); + return this; + } + + /** + * Filter results by those that are related to a specific users id + * + */ + public Builder accountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Filters content by field and direction/equality + * (Unknown if viewedAt is the only supported column) + * + */ + public Builder filter(Filter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + /** + * Filters content by field and direction/equality + * (Unknown if viewedAt is the only supported column) + * + */ + public Builder filter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + /** + * Filters the results based on the id of a valid library section + * + */ + public Builder librarySectionID(long librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = Optional.ofNullable(librarySectionID); + return this; + } + + /** + * Filters the results based on the id of a valid library section + * + */ + public Builder librarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + public GetSessionHistoryRequest build() { + return new GetSessionHistoryRequest( + sort, + accountId, + filter, + librarySectionID); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryRequestBuilder.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryRequestBuilder.java index 7e2df1ba..888b9301 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryRequestBuilder.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryRequestBuilder.java @@ -19,14 +19,70 @@ import org.openapitools.jackson.nullable.JsonNullable; 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 SDKMethodInterfaces.MethodCallGetSessionHistory sdk; public GetSessionHistoryRequestBuilder(SDKMethodInterfaces.MethodCallGetSessionHistory sdk) { this.sdk = sdk; } + + 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(Filter 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; + } public GetSessionHistoryResponse call() throws Exception { - return sdk.getSessionHistoryDirect(); + return sdk.getSessionHistory( + sort, + accountId, + filter, + librarySectionID); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryResponse.java index 95e74d16..39dcc58d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util /** * List of Plex Sessions */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetSessionHistoryResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util /** * List of Plex Sessions */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util /** * List of Plex Sessions */ - public GetSessionHistoryResponse withTwoHundredApplicationJsonObject(GetSessionHistoryResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetSessionHistoryResponse withObject(GetSessionHistoryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * List of Plex Sessions */ - public GetSessionHistoryResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetSessionHistoryResponse withFourHundredAndOneApplicationJsonObject(GetSessionHistorySessionsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetSessionHistoryResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetSessionHistoryResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util /** * List of Plex Sessions */ - public Builder twoHundredApplicationJsonObject(GetSessionHistoryResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetSessionHistoryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * List of Plex Sessions */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetSessionHistorySessionsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetSessionHistoryResponse implements lukehagar.plexapi.plexapi.util contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryResponseBody.java index 2d860635..277b49b6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistoryResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetSessionHistoryResponseBody - List of Plex Sessions */ @@ -26,14 +27,21 @@ public class GetSessionHistoryResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetSessionHistoryResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetSessionHistoryResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistorySessionsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistorySessionsResponseBody.java deleted file mode 100644 index 9d11f2a7..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionHistorySessionsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetSessionHistorySessionsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetSessionHistorySessionsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetSessionHistorySessionsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetSessionHistorySessionsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetSessionHistorySessionsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetSessionHistorySessionsResponseBody other = (GetSessionHistorySessionsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetSessionHistorySessionsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetSessionHistorySessionsResponseBody build() { - return new GetSessionHistorySessionsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMedia.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMedia.java index 0008524d..df243c55 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMedia.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMedia.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionsMedia { @JsonInclude(Include.NON_ABSENT) @@ -51,6 +52,7 @@ public class GetSessionsMedia { @JsonProperty("Part") private Optional> part; + @JsonCreator public GetSessionsMedia( @JsonProperty("audioChannels") Optional audioChannels, @JsonProperty("audioCodec") Optional audioCodec, @@ -77,37 +79,57 @@ public class GetSessionsMedia { this.selected = selected; this.part = part; } - - public Optional audioChannels() { - return audioChannels; + + public GetSessionsMedia() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional audioCodec() { - return audioCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioChannels() { + return (Optional) audioChannels; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioCodec() { + return (Optional) audioCodec; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional id() { - return id; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional selected() { - return selected; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional> part() { - return part; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional selected() { + return (Optional) selected; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> part() { + return (Optional>) part; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMediaContainer.java index 0b3ae750..3fd81fec 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class GetSessionsMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public GetSessionsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("Metadata") Optional> metadata) { @@ -35,13 +37,21 @@ public class GetSessionsMediaContainer { this.size = size; this.metadata = metadata; } - - public Optional size() { - return size; + + public GetSessionsMediaContainer() { + this(Optional.empty(), Optional.empty()); } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMetadata.java index 9927e365..a632a8c3 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionsMetadata { @JsonInclude(Include.NON_ABSENT) @@ -157,7 +158,7 @@ public class GetSessionsMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("User") - private Optional user; + private Optional user; @JsonInclude(Include.NON_ABSENT) @JsonProperty("Player") @@ -167,6 +168,7 @@ public class GetSessionsMetadata { @JsonProperty("Session") private Optional session; + @JsonCreator public GetSessionsMetadata( @JsonProperty("addedAt") Optional addedAt, @JsonProperty("art") Optional art, @@ -202,7 +204,7 @@ public class GetSessionsMetadata { @JsonProperty("updatedAt") Optional updatedAt, @JsonProperty("viewOffset") Optional viewOffset, @JsonProperty("Media") Optional> media, - @JsonProperty("User") Optional user, + @JsonProperty("User") Optional user, @JsonProperty("Player") Optional player, @JsonProperty("Session") Optional session) { Utils.checkNotNull(addedAt, "addedAt"); @@ -280,153 +282,231 @@ public class GetSessionsMetadata { this.player = player; this.session = session; } - - public Optional addedAt() { - return addedAt; + + 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()); } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional grandparentArt() { - return grandparentArt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional grandparentGuid() { - return grandparentGuid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentArt() { + return (Optional) grandparentArt; } - public Optional grandparentKey() { - return grandparentKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentGuid() { + return (Optional) grandparentGuid; } - public Optional grandparentRatingKey() { - return grandparentRatingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentKey() { + return (Optional) grandparentKey; } - public Optional grandparentThumb() { - return grandparentThumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentRatingKey() { + return (Optional) grandparentRatingKey; } - public Optional grandparentTitle() { - return grandparentTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentThumb() { + return (Optional) grandparentThumb; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional grandparentTitle() { + return (Optional) grandparentTitle; } - public Optional index() { - return index; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional index() { + return (Optional) index; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional librarySectionKey() { - return librarySectionKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionKey() { + return (Optional) librarySectionKey; } - public Optional musicAnalysisVersion() { - return musicAnalysisVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; } - public Optional parentGuid() { - return parentGuid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional musicAnalysisVersion() { + return (Optional) musicAnalysisVersion; } - public Optional parentIndex() { - return parentIndex; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentGuid() { + return (Optional) parentGuid; } - public Optional parentKey() { - return parentKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentIndex() { + return (Optional) parentIndex; } - public Optional parentRatingKey() { - return parentRatingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentKey() { + return (Optional) parentKey; } - public Optional parentStudio() { - return parentStudio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentRatingKey() { + return (Optional) parentRatingKey; } - public Optional parentThumb() { - return parentThumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentStudio() { + return (Optional) parentStudio; } - public Optional parentTitle() { - return parentTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentThumb() { + return (Optional) parentThumb; } - public Optional parentYear() { - return parentYear; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentTitle() { + return (Optional) parentTitle; } - public Optional ratingCount() { - return ratingCount; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentYear() { + return (Optional) parentYear; } - public Optional ratingKey() { - return ratingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingCount() { + return (Optional) ratingCount; } - public Optional sessionKey() { - return sessionKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sessionKey() { + return (Optional) sessionKey; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional titleSort() { - return titleSort; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional titleSort() { + return (Optional) titleSort; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional viewOffset() { - return viewOffset; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional> media() { - return media; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewOffset() { + return (Optional) viewOffset; } - public Optional user() { - return user; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> media() { + return (Optional>) media; } - public Optional player() { - return player; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; } - public Optional session() { - return session; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional player() { + return (Optional) player; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional session() { + return (Optional) session; } public final static Builder builder() { @@ -841,13 +921,13 @@ public class GetSessionsMetadata { return this; } - public GetSessionsMetadata withUser(User user) { + public GetSessionsMetadata withUser(GetSessionsUser user) { Utils.checkNotNull(user, "user"); this.user = Optional.ofNullable(user); return this; } - public GetSessionsMetadata withUser(Optional user) { + public GetSessionsMetadata withUser(Optional user) { Utils.checkNotNull(user, "user"); this.user = user; return this; @@ -1080,7 +1160,7 @@ public class GetSessionsMetadata { private Optional> media = Optional.empty(); - private Optional user = Optional.empty(); + private Optional user = Optional.empty(); private Optional player = Optional.empty(); @@ -1498,13 +1578,13 @@ public class GetSessionsMetadata { return this; } - public Builder user(User user) { + public Builder user(GetSessionsUser user) { Utils.checkNotNull(user, "user"); this.user = Optional.ofNullable(user); return this; } - public Builder user(Optional user) { + public Builder user(Optional user) { Utils.checkNotNull(user, "user"); this.user = user; return this; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsPart.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsPart.java index f85f175b..7735cdbb 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsPart.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsPart.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionsPart { @JsonInclude(Include.NON_ABSENT) @@ -59,6 +60,7 @@ public class GetSessionsPart { @JsonProperty("Stream") private Optional> stream; + @JsonCreator public GetSessionsPart( @JsonProperty("container") Optional container, @JsonProperty("duration") Optional duration, @@ -91,45 +93,69 @@ public class GetSessionsPart { this.selected = selected; this.stream = stream; } - - public Optional container() { - return container; + + public GetSessionsPart() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional file() { - return file; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional hasThumbnail() { - return hasThumbnail; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional file() { + return (Optional) file; } - public Optional id() { - return id; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasThumbnail() { + return (Optional) hasThumbnail; } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional decision() { - return decision; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional selected() { - return selected; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional decision() { + return (Optional) decision; } - public Optional> stream() { - return stream; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional selected() { + return (Optional) selected; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> stream() { + return (Optional>) stream; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsResponse.java index ddaca8fd..b79b14ed 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * List of Active Plex Sessions */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetSessionsResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * List of Active Plex Sessions */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * List of Active Plex Sessions */ - public GetSessionsResponse withTwoHundredApplicationJsonObject(GetSessionsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetSessionsResponse withObject(GetSessionsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * List of Active Plex Sessions */ - public GetSessionsResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetSessionsResponse withFourHundredAndOneApplicationJsonObject(GetSessionsSessionsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetSessionsResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetSessionsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * List of Active Plex Sessions */ - public Builder twoHundredApplicationJsonObject(GetSessionsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetSessionsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * List of Active Plex Sessions */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetSessionsSessionsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetSessionsResponse implements lukehagar.plexapi.plexapi.utils.Resp contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsResponseBody.java index 64a90e36..9e28604b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetSessionsResponseBody - List of Active Plex Sessions */ @@ -26,14 +27,21 @@ public class GetSessionsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetSessionsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetSessionsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsSessionsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsSessionsResponseBody.java deleted file mode 100644 index b6b91df1..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsSessionsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetSessionsSessionsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetSessionsSessionsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetSessionsSessionsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetSessionsSessionsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetSessionsSessionsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetSessionsSessionsResponseBody other = (GetSessionsSessionsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetSessionsSessionsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetSessionsSessionsResponseBody build() { - return new GetSessionsSessionsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsStream.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsStream.java index 913191df..645f24a1 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsStream.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsStream.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSessionsStream { @JsonInclude(Include.NON_ABSENT) @@ -99,6 +100,7 @@ public class GetSessionsStream { @JsonProperty("location") private Optional location; + @JsonCreator public GetSessionsStream( @JsonProperty("albumGain") Optional albumGain, @JsonProperty("albumPeak") Optional albumPeak, @@ -161,85 +163,129 @@ public class GetSessionsStream { this.streamType = streamType; this.location = location; } - - public Optional albumGain() { - return albumGain; + + 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()); } - public Optional albumPeak() { - return albumPeak; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional albumGain() { + return (Optional) albumGain; } - public Optional albumRange() { - return albumRange; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional albumPeak() { + return (Optional) albumPeak; } - public Optional audioChannelLayout() { - return audioChannelLayout; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional albumRange() { + return (Optional) albumRange; } - public Optional bitDepth() { - return bitDepth; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioChannelLayout() { + return (Optional) audioChannelLayout; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitDepth() { + return (Optional) bitDepth; } - public Optional channels() { - return channels; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional codec() { - return codec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional channels() { + return (Optional) channels; } - public Optional displayTitle() { - return displayTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional codec() { + return (Optional) codec; } - public Optional extendedDisplayTitle() { - return extendedDisplayTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional displayTitle() { + return (Optional) displayTitle; } - public Optional gain() { - return gain; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional extendedDisplayTitle() { + return (Optional) extendedDisplayTitle; } - public Optional id() { - return id; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional gain() { + return (Optional) gain; } - public Optional index() { - return index; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional loudness() { - return loudness; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional index() { + return (Optional) index; } - public Optional lra() { - return lra; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional loudness() { + return (Optional) loudness; } - public Optional peak() { - return peak; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lra() { + return (Optional) lra; } - public Optional samplingRate() { - return samplingRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional peak() { + return (Optional) peak; } - public Optional selected() { - return selected; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional samplingRate() { + return (Optional) samplingRate; } - public Optional streamType() { - return streamType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional selected() { + return (Optional) selected; } - public Optional location() { - return location; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional streamType() { + return (Optional) streamType; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional location() { + return (Optional) location; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsUser.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsUser.java new file mode 100644 index 00000000..438c3f07 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSessionsUser.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public GetSessionsUser( + @JsonProperty("id") Optional id, + @JsonProperty("thumb") Optional thumb, + @JsonProperty("title") Optional title) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(thumb, "thumb"); + Utils.checkNotNull(title, "title"); + this.id = id; + this.thumb = thumb; + this.title = title; + } + + public GetSessionsUser() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSessionsUser withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public GetSessionsUser withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetSessionsUser withThumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public GetSessionsUser withThumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public GetSessionsUser withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.ofNullable(title); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionsUser other = (GetSessionsUser) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.thumb, other.thumb) && + java.util.Objects.deepEquals(this.title, other.title); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + thumb, + title); + } + + @Override + public String toString() { + return Utils.toString(GetSessionsUser.class, + "id", id, + "thumb", thumb, + "title", title); + } + + 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); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder thumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public Builder thumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.ofNullable(title); + return this; + } + + public Builder title(Optional title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public GetSessionsUser build() { + return new GetSessionsUser( + id, + thumb, + title); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationRequest.java index b3958e10..a56db5eb 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSourceConnectionInformationRequest { /** @@ -22,6 +23,7 @@ public class GetSourceConnectionInformationRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=source") private String source; + @JsonCreator public GetSourceConnectionInformationRequest( String source) { Utils.checkNotNull(source, "source"); @@ -31,6 +33,7 @@ public class GetSourceConnectionInformationRequest { /** * The source identifier with an included prefix. */ + @JsonIgnore public String source() { return source; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationResponse.java index 7214da77..b5999057 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetSourceConnectionInformationResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetSourceConnectionInformationResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class GetSourceConnectionInformationResponse implements lukehagar.plexapi */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public GetSourceConnectionInformationResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class GetSourceConnectionInformationResponse implements lukehagar.plexapi /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class GetSourceConnectionInformationResponse implements lukehagar.plexapi /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class GetSourceConnectionInformationResponse implements lukehagar.plexapi this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetSourceConnectionInformationResponse withObject(GetSourceConnectionInformationResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetSourceConnectionInformationResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class GetSourceConnectionInformationResponse implements lukehagar.plexapi return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class GetSourceConnectionInformationResponse implements lukehagar.plexapi return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class GetSourceConnectionInformationResponse implements lukehagar.plexapi return Utils.toString(GetSourceConnectionInformationResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class GetSourceConnectionInformationResponse implements lukehagar.plexapi private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class GetSourceConnectionInformationResponse implements lukehagar.plexapi this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(GetSourceConnectionInformationResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public GetSourceConnectionInformationResponse build() { return new GetSourceConnectionInformationResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsDevice.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsDevice.java index d06c54ad..c188d53b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsDevice.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsDevice.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetStatisticsDevice { @JsonInclude(Include.NON_ABSENT) @@ -39,6 +40,7 @@ public class GetStatisticsDevice { @JsonProperty("createdAt") private Optional createdAt; + @JsonCreator public GetStatisticsDevice( @JsonProperty("id") Optional id, @JsonProperty("name") Optional name, @@ -56,25 +58,39 @@ public class GetStatisticsDevice { this.clientIdentifier = clientIdentifier; this.createdAt = createdAt; } - - public Optional id() { - return id; + + public GetStatisticsDevice() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional name() { - return name; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional platform() { - return platform; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; } - public Optional clientIdentifier() { - return clientIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platform() { + return (Optional) platform; } - public Optional createdAt() { - return createdAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional clientIdentifier() { + return (Optional) clientIdentifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsMediaContainer.java index 0e505f55..5d88fd9f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetStatisticsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -35,6 +36,7 @@ public class GetStatisticsMediaContainer { @JsonProperty("StatisticsMedia") private Optional> statisticsMedia; + @JsonCreator public GetStatisticsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("Device") Optional> device, @@ -49,21 +51,33 @@ public class GetStatisticsMediaContainer { this.account = account; this.statisticsMedia = statisticsMedia; } - - public Optional size() { - return size; + + public GetStatisticsMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional> device() { - return device; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional> account() { - return account; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> device() { + return (Optional>) device; } - public Optional> statisticsMedia() { - return statisticsMedia; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> account() { + return (Optional>) account; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> statisticsMedia() { + return (Optional>) statisticsMedia; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsRequest.java index ddaf9a6e..702cfe82 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetStatisticsRequest { /** @@ -25,19 +26,26 @@ public class GetStatisticsRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=Timespan") private Optional timespan; + @JsonCreator public GetStatisticsRequest( Optional timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = timespan; } + + public GetStatisticsRequest() { + this(Optional.empty()); + } /** * The timespan to retrieve statistics for * the exact meaning of this parameter is not known * */ - public Optional timespan() { - return timespan; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional timespan() { + return (Optional) timespan; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsResponse.java index fe6d7293..33f14469 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Media Statistics */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetStatisticsResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Media Statistics */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Media Statistics */ - public GetStatisticsResponse withTwoHundredApplicationJsonObject(GetStatisticsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetStatisticsResponse withObject(GetStatisticsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Media Statistics */ - public GetStatisticsResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetStatisticsResponse withFourHundredAndOneApplicationJsonObject(GetStatisticsStatisticsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetStatisticsResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetStatisticsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Media Statistics */ - public Builder twoHundredApplicationJsonObject(GetStatisticsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetStatisticsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * Media Statistics */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetStatisticsStatisticsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetStatisticsResponse implements lukehagar.plexapi.plexapi.utils.Re contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsResponseBody.java index 3f295f36..5298686d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetStatisticsResponseBody - Media Statistics */ @@ -26,14 +27,21 @@ public class GetStatisticsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetStatisticsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetStatisticsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsStatisticsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsStatisticsResponseBody.java deleted file mode 100644 index a3082e3b..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetStatisticsStatisticsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetStatisticsStatisticsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetStatisticsStatisticsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetStatisticsStatisticsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetStatisticsStatisticsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetStatisticsStatisticsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetStatisticsStatisticsResponseBody other = (GetStatisticsStatisticsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetStatisticsStatisticsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetStatisticsStatisticsResponseBody build() { - return new GetStatisticsStatisticsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineRequest.java index 14cdcc48..c6a990dc 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTimelineRequest { /** @@ -76,6 +77,7 @@ public class GetTimelineRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=row") private double row; + @JsonCreator public GetTimelineRequest( double ratingKey, String key, @@ -112,6 +114,7 @@ public class GetTimelineRequest { /** * The rating key of the media item */ + @JsonIgnore public double ratingKey() { return ratingKey; } @@ -119,6 +122,7 @@ public class GetTimelineRequest { /** * The key of the media item to get the timeline for */ + @JsonIgnore public String key() { return key; } @@ -126,6 +130,7 @@ public class GetTimelineRequest { /** * The state of the media item */ + @JsonIgnore public State state() { return state; } @@ -133,6 +138,7 @@ public class GetTimelineRequest { /** * Whether the media item has MDE */ + @JsonIgnore public double hasMDE() { return hasMDE; } @@ -140,6 +146,7 @@ public class GetTimelineRequest { /** * The time of the media item */ + @JsonIgnore public double time() { return time; } @@ -147,6 +154,7 @@ public class GetTimelineRequest { /** * The duration of the media item */ + @JsonIgnore public double duration() { return duration; } @@ -154,6 +162,7 @@ public class GetTimelineRequest { /** * The context of the media item */ + @JsonIgnore public String context() { return context; } @@ -161,6 +170,7 @@ public class GetTimelineRequest { /** * The play queue item ID of the media item */ + @JsonIgnore public double playQueueItemID() { return playQueueItemID; } @@ -168,6 +178,7 @@ public class GetTimelineRequest { /** * The playback time of the media item */ + @JsonIgnore public double playBackTime() { return playBackTime; } @@ -175,6 +186,7 @@ public class GetTimelineRequest { /** * The row of the media item */ + @JsonIgnore public double row() { return row; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineResponse.java index cdf4e6f5..360c79ca 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTimelineResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTimelineResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class GetTimelineResponse implements lukehagar.plexapi.plexapi.utils.Resp */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public GetTimelineResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class GetTimelineResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class GetTimelineResponse implements lukehagar.plexapi.plexapi.utils.Resp /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class GetTimelineResponse implements lukehagar.plexapi.plexapi.utils.Resp this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetTimelineResponse withObject(GetTimelineResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetTimelineResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class GetTimelineResponse implements lukehagar.plexapi.plexapi.utils.Resp return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class GetTimelineResponse implements lukehagar.plexapi.plexapi.utils.Resp return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class GetTimelineResponse implements lukehagar.plexapi.plexapi.utils.Resp return Utils.toString(GetTimelineResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class GetTimelineResponse implements lukehagar.plexapi.plexapi.utils.Resp private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class GetTimelineResponse implements lukehagar.plexapi.plexapi.utils.Resp this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(GetTimelineResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public GetTimelineResponse build() { return new GetTimelineResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenLocation.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenLocation.java new file mode 100644 index 00000000..7cc76d33 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenLocation.java @@ -0,0 +1,498 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetTokenLocation { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("code") + private Optional code; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("european_union_member") + private Optional europeanUnionMember; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("continent_code") + private Optional continentCode; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("country") + private Optional country; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("city") + private Optional city; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("time_zone") + private Optional timeZone; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("postal_code") + private Optional postalCode; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("in_privacy_restricted_country") + private Optional inPrivacyRestrictedCountry; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subdivisions") + private Optional subdivisions; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("coordinates") + private Optional coordinates; + + @JsonCreator + public GetTokenLocation( + @JsonProperty("code") Optional code, + @JsonProperty("european_union_member") Optional europeanUnionMember, + @JsonProperty("continent_code") Optional continentCode, + @JsonProperty("country") Optional country, + @JsonProperty("city") Optional city, + @JsonProperty("time_zone") Optional timeZone, + @JsonProperty("postal_code") Optional postalCode, + @JsonProperty("in_privacy_restricted_country") Optional inPrivacyRestrictedCountry, + @JsonProperty("subdivisions") Optional subdivisions, + @JsonProperty("coordinates") Optional coordinates) { + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(europeanUnionMember, "europeanUnionMember"); + Utils.checkNotNull(continentCode, "continentCode"); + Utils.checkNotNull(country, "country"); + Utils.checkNotNull(city, "city"); + Utils.checkNotNull(timeZone, "timeZone"); + Utils.checkNotNull(postalCode, "postalCode"); + Utils.checkNotNull(inPrivacyRestrictedCountry, "inPrivacyRestrictedCountry"); + Utils.checkNotNull(subdivisions, "subdivisions"); + Utils.checkNotNull(coordinates, "coordinates"); + this.code = code; + this.europeanUnionMember = europeanUnionMember; + this.continentCode = continentCode; + this.country = country; + this.city = city; + this.timeZone = timeZone; + this.postalCode = postalCode; + this.inPrivacyRestrictedCountry = inPrivacyRestrictedCountry; + this.subdivisions = subdivisions; + this.coordinates = coordinates; + } + + public GetTokenLocation() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional europeanUnionMember() { + return (Optional) europeanUnionMember; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional continentCode() { + return (Optional) continentCode; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional country() { + return (Optional) country; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional city() { + return (Optional) city; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional timeZone() { + return (Optional) timeZone; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional postalCode() { + return (Optional) postalCode; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional inPrivacyRestrictedCountry() { + return (Optional) inPrivacyRestrictedCountry; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subdivisions() { + return (Optional) subdivisions; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional coordinates() { + return (Optional) coordinates; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetTokenLocation withCode(String code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public GetTokenLocation withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public GetTokenLocation withEuropeanUnionMember(boolean europeanUnionMember) { + Utils.checkNotNull(europeanUnionMember, "europeanUnionMember"); + this.europeanUnionMember = Optional.ofNullable(europeanUnionMember); + return this; + } + + public GetTokenLocation withEuropeanUnionMember(Optional europeanUnionMember) { + Utils.checkNotNull(europeanUnionMember, "europeanUnionMember"); + this.europeanUnionMember = europeanUnionMember; + return this; + } + + public GetTokenLocation withContinentCode(String continentCode) { + Utils.checkNotNull(continentCode, "continentCode"); + this.continentCode = Optional.ofNullable(continentCode); + return this; + } + + public GetTokenLocation withContinentCode(Optional continentCode) { + Utils.checkNotNull(continentCode, "continentCode"); + this.continentCode = continentCode; + return this; + } + + public GetTokenLocation withCountry(String country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + public GetTokenLocation withCountry(Optional country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + public GetTokenLocation withCity(String city) { + Utils.checkNotNull(city, "city"); + this.city = Optional.ofNullable(city); + return this; + } + + public GetTokenLocation withCity(Optional city) { + Utils.checkNotNull(city, "city"); + this.city = city; + return this; + } + + public GetTokenLocation withTimeZone(String timeZone) { + Utils.checkNotNull(timeZone, "timeZone"); + this.timeZone = Optional.ofNullable(timeZone); + return this; + } + + public GetTokenLocation withTimeZone(Optional timeZone) { + Utils.checkNotNull(timeZone, "timeZone"); + this.timeZone = timeZone; + return this; + } + + public GetTokenLocation withPostalCode(String postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = Optional.ofNullable(postalCode); + return this; + } + + public GetTokenLocation withPostalCode(Optional postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = postalCode; + return this; + } + + public GetTokenLocation withInPrivacyRestrictedCountry(boolean inPrivacyRestrictedCountry) { + Utils.checkNotNull(inPrivacyRestrictedCountry, "inPrivacyRestrictedCountry"); + this.inPrivacyRestrictedCountry = Optional.ofNullable(inPrivacyRestrictedCountry); + return this; + } + + public GetTokenLocation withInPrivacyRestrictedCountry(Optional inPrivacyRestrictedCountry) { + Utils.checkNotNull(inPrivacyRestrictedCountry, "inPrivacyRestrictedCountry"); + this.inPrivacyRestrictedCountry = inPrivacyRestrictedCountry; + return this; + } + + public GetTokenLocation withSubdivisions(String subdivisions) { + Utils.checkNotNull(subdivisions, "subdivisions"); + this.subdivisions = Optional.ofNullable(subdivisions); + return this; + } + + public GetTokenLocation withSubdivisions(Optional subdivisions) { + Utils.checkNotNull(subdivisions, "subdivisions"); + this.subdivisions = subdivisions; + return this; + } + + public GetTokenLocation withCoordinates(String coordinates) { + Utils.checkNotNull(coordinates, "coordinates"); + this.coordinates = Optional.ofNullable(coordinates); + return this; + } + + public GetTokenLocation withCoordinates(Optional coordinates) { + Utils.checkNotNull(coordinates, "coordinates"); + this.coordinates = coordinates; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTokenLocation other = (GetTokenLocation) o; + return + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.europeanUnionMember, other.europeanUnionMember) && + java.util.Objects.deepEquals(this.continentCode, other.continentCode) && + java.util.Objects.deepEquals(this.country, other.country) && + java.util.Objects.deepEquals(this.city, other.city) && + java.util.Objects.deepEquals(this.timeZone, other.timeZone) && + java.util.Objects.deepEquals(this.postalCode, other.postalCode) && + java.util.Objects.deepEquals(this.inPrivacyRestrictedCountry, other.inPrivacyRestrictedCountry) && + java.util.Objects.deepEquals(this.subdivisions, other.subdivisions) && + java.util.Objects.deepEquals(this.coordinates, other.coordinates); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + code, + europeanUnionMember, + continentCode, + country, + city, + timeZone, + postalCode, + inPrivacyRestrictedCountry, + subdivisions, + coordinates); + } + + @Override + public String toString() { + return Utils.toString(GetTokenLocation.class, + "code", code, + "europeanUnionMember", europeanUnionMember, + "continentCode", continentCode, + "country", country, + "city", city, + "timeZone", timeZone, + "postalCode", postalCode, + "inPrivacyRestrictedCountry", inPrivacyRestrictedCountry, + "subdivisions", subdivisions, + "coordinates", coordinates); + } + + public final static class Builder { + + private Optional code = Optional.empty(); + + private Optional europeanUnionMember = Optional.empty(); + + private Optional continentCode = Optional.empty(); + + private Optional country = Optional.empty(); + + private Optional city = Optional.empty(); + + private Optional timeZone = Optional.empty(); + + private Optional postalCode = Optional.empty(); + + private Optional inPrivacyRestrictedCountry = Optional.empty(); + + private Optional subdivisions = Optional.empty(); + + private Optional coordinates = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder code(String 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 europeanUnionMember(boolean europeanUnionMember) { + Utils.checkNotNull(europeanUnionMember, "europeanUnionMember"); + this.europeanUnionMember = Optional.ofNullable(europeanUnionMember); + return this; + } + + public Builder europeanUnionMember(Optional europeanUnionMember) { + Utils.checkNotNull(europeanUnionMember, "europeanUnionMember"); + this.europeanUnionMember = europeanUnionMember; + return this; + } + + public Builder continentCode(String continentCode) { + Utils.checkNotNull(continentCode, "continentCode"); + this.continentCode = Optional.ofNullable(continentCode); + return this; + } + + public Builder continentCode(Optional continentCode) { + Utils.checkNotNull(continentCode, "continentCode"); + this.continentCode = continentCode; + return this; + } + + public Builder country(String country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + public Builder country(Optional country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + public Builder city(String city) { + Utils.checkNotNull(city, "city"); + this.city = Optional.ofNullable(city); + return this; + } + + public Builder city(Optional city) { + Utils.checkNotNull(city, "city"); + this.city = city; + return this; + } + + public Builder timeZone(String timeZone) { + Utils.checkNotNull(timeZone, "timeZone"); + this.timeZone = Optional.ofNullable(timeZone); + return this; + } + + public Builder timeZone(Optional timeZone) { + Utils.checkNotNull(timeZone, "timeZone"); + this.timeZone = timeZone; + return this; + } + + public Builder postalCode(String postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = Optional.ofNullable(postalCode); + return this; + } + + public Builder postalCode(Optional postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = postalCode; + return this; + } + + public Builder inPrivacyRestrictedCountry(boolean inPrivacyRestrictedCountry) { + Utils.checkNotNull(inPrivacyRestrictedCountry, "inPrivacyRestrictedCountry"); + this.inPrivacyRestrictedCountry = Optional.ofNullable(inPrivacyRestrictedCountry); + return this; + } + + public Builder inPrivacyRestrictedCountry(Optional inPrivacyRestrictedCountry) { + Utils.checkNotNull(inPrivacyRestrictedCountry, "inPrivacyRestrictedCountry"); + this.inPrivacyRestrictedCountry = inPrivacyRestrictedCountry; + return this; + } + + public Builder subdivisions(String subdivisions) { + Utils.checkNotNull(subdivisions, "subdivisions"); + this.subdivisions = Optional.ofNullable(subdivisions); + return this; + } + + public Builder subdivisions(Optional subdivisions) { + Utils.checkNotNull(subdivisions, "subdivisions"); + this.subdivisions = subdivisions; + return this; + } + + public Builder coordinates(String coordinates) { + Utils.checkNotNull(coordinates, "coordinates"); + this.coordinates = Optional.ofNullable(coordinates); + return this; + } + + public Builder coordinates(Optional coordinates) { + Utils.checkNotNull(coordinates, "coordinates"); + this.coordinates = coordinates; + return this; + } + + public GetTokenLocation build() { + return new GetTokenLocation( + code, + europeanUnionMember, + continentCode, + country, + city, + timeZone, + postalCode, + inPrivacyRestrictedCountry, + subdivisions, + coordinates); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequest.java index 42cd7b7d..329110fb 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequest.java @@ -4,16 +4,18 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTokenRequest { /** @@ -29,20 +31,27 @@ public class GetTokenRequest { * */ @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier") - private String xPlexClientIdentifier; + private Optional xPlexClientIdentifier; + @JsonCreator public GetTokenRequest( String pinID, - String xPlexClientIdentifier) { + Optional xPlexClientIdentifier) { Utils.checkNotNull(pinID, "pinID"); Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); this.pinID = pinID; this.xPlexClientIdentifier = xPlexClientIdentifier; } + + public GetTokenRequest( + String pinID) { + this(pinID, Optional.empty()); + } /** * The PinID to retrieve an access token for */ + @JsonIgnore public String pinID() { return pinID; } @@ -53,8 +62,10 @@ public class GetTokenRequest { * (UUID, serial number, or other number unique per device) * */ - public String xPlexClientIdentifier() { - return xPlexClientIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional xPlexClientIdentifier() { + return (Optional) xPlexClientIdentifier; } public final static Builder builder() { @@ -77,6 +88,18 @@ public class GetTokenRequest { * */ public GetTokenRequest withXPlexClientIdentifier(String xPlexClientIdentifier) { + Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); + this.xPlexClientIdentifier = Optional.ofNullable(xPlexClientIdentifier); + return this; + } + + /** + * The unique identifier for the client application + * This is used to track the client application and its usage + * (UUID, serial number, or other number unique per device) + * + */ + public GetTokenRequest withXPlexClientIdentifier(Optional xPlexClientIdentifier) { Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); this.xPlexClientIdentifier = xPlexClientIdentifier; return this; @@ -114,7 +137,7 @@ public class GetTokenRequest { private String pinID; - private String xPlexClientIdentifier; + private Optional xPlexClientIdentifier = Optional.empty(); private Builder() { // force use of static builder() method @@ -136,6 +159,18 @@ public class GetTokenRequest { * */ public Builder xPlexClientIdentifier(String xPlexClientIdentifier) { + Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); + this.xPlexClientIdentifier = Optional.ofNullable(xPlexClientIdentifier); + return this; + } + + /** + * The unique identifier for the client application + * This is used to track the client application and its usage + * (UUID, serial number, or other number unique per device) + * + */ + public Builder xPlexClientIdentifier(Optional xPlexClientIdentifier) { Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); this.xPlexClientIdentifier = xPlexClientIdentifier; return this; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequestBuilder.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequestBuilder.java index e0412642..b3bc41c0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequestBuilder.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenRequestBuilder.java @@ -20,7 +20,7 @@ import org.openapitools.jackson.nullable.JsonNullable; public class GetTokenRequestBuilder { private String pinID; - private String xPlexClientIdentifier; + private Optional xPlexClientIdentifier = Optional.empty(); private java.util.Optional serverURL = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetToken sdk; @@ -33,8 +33,14 @@ public class GetTokenRequestBuilder { this.pinID = pinID; return this; } - + public GetTokenRequestBuilder xPlexClientIdentifier(String xPlexClientIdentifier) { + Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); + this.xPlexClientIdentifier = Optional.of(xPlexClientIdentifier); + return this; + } + + public GetTokenRequestBuilder xPlexClientIdentifier(Optional xPlexClientIdentifier) { Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier"); this.xPlexClientIdentifier = xPlexClientIdentifier; return this; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponse.java index 5ca29199..2557104e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTokenResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -33,10 +34,11 @@ public class GetTokenResponse implements lukehagar.plexapi.plexapi.utils.Respons private HttpResponse rawResponse; /** - * X-Plex-Client-Identifier is missing + * Access Token */ private Optional object; + @JsonCreator public GetTokenResponse( String contentType, int statusCode, @@ -51,10 +53,18 @@ public class GetTokenResponse implements lukehagar.plexapi.plexapi.utils.Respons this.rawResponse = rawResponse; this.object = object; } + + public GetTokenResponse( + 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; } @@ -62,6 +72,7 @@ public class GetTokenResponse implements lukehagar.plexapi.plexapi.utils.Respons /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,15 +80,18 @@ public class GetTokenResponse implements lukehagar.plexapi.plexapi.utils.Respons /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } /** - * X-Plex-Client-Identifier is missing + * Access Token */ - public Optional object() { - return object; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -112,7 +126,7 @@ public class GetTokenResponse implements lukehagar.plexapi.plexapi.utils.Respons } /** - * X-Plex-Client-Identifier is missing + * Access Token */ public GetTokenResponse withObject(GetTokenResponseBody object) { Utils.checkNotNull(object, "object"); @@ -121,7 +135,7 @@ public class GetTokenResponse implements lukehagar.plexapi.plexapi.utils.Respons } /** - * X-Plex-Client-Identifier is missing + * Access Token */ public GetTokenResponse withObject(Optional object) { Utils.checkNotNull(object, "object"); @@ -205,7 +219,7 @@ public class GetTokenResponse implements lukehagar.plexapi.plexapi.utils.Respons } /** - * X-Plex-Client-Identifier is missing + * Access Token */ public Builder object(GetTokenResponseBody object) { Utils.checkNotNull(object, "object"); @@ -214,7 +228,7 @@ public class GetTokenResponse implements lukehagar.plexapi.plexapi.utils.Respons } /** - * X-Plex-Client-Identifier is missing + * Access Token */ public Builder object(Optional object) { Utils.checkNotNull(object, "object"); diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponseBody.java index 8948bcd1..75eb7f1c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTokenResponseBody.java @@ -4,51 +4,373 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; +import java.time.OffsetDateTime; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** - * GetTokenResponseBody - X-Plex-Client-Identifier is missing + * GetTokenResponseBody - Access Token */ public class GetTokenResponseBody { + /** + * PinID for use with authentication + */ @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; + @JsonProperty("id") + private Optional id; + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("code") + private Optional code; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("product") + private Optional product; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("trusted") + private Optional trusted; + + /** + * a link to a QR code hosted on plex.tv + * The QR code redirects to the relevant `plex.tv/link` authentication page + * Which then prompts the user for the 4 Digit Link Pin + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("qr") + private Optional qr; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("clientIdentifier") + private Optional clientIdentifier; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("location") + private Optional location; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expiresIn") + private Optional expiresIn; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdAt") + private Optional createdAt; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expiresAt") + private Optional expiresAt; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("authToken") + private Optional authToken; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("newRegistration") + private Optional newRegistration; + + @JsonCreator public GetTokenResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; + @JsonProperty("id") Optional id, + @JsonProperty("code") Optional code, + @JsonProperty("product") Optional product, + @JsonProperty("trusted") Optional trusted, + @JsonProperty("qr") Optional qr, + @JsonProperty("clientIdentifier") Optional clientIdentifier, + @JsonProperty("location") Optional location, + @JsonProperty("expiresIn") Optional expiresIn, + @JsonProperty("createdAt") Optional createdAt, + @JsonProperty("expiresAt") Optional expiresAt, + @JsonProperty("authToken") Optional authToken, + @JsonProperty("newRegistration") Optional newRegistration) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(product, "product"); + Utils.checkNotNull(trusted, "trusted"); + Utils.checkNotNull(qr, "qr"); + Utils.checkNotNull(clientIdentifier, "clientIdentifier"); + Utils.checkNotNull(location, "location"); + Utils.checkNotNull(expiresIn, "expiresIn"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(expiresAt, "expiresAt"); + Utils.checkNotNull(authToken, "authToken"); + Utils.checkNotNull(newRegistration, "newRegistration"); + this.id = id; + this.code = code; + this.product = product; + this.trusted = trusted; + this.qr = qr; + this.clientIdentifier = clientIdentifier; + this.location = location; + this.expiresIn = expiresIn; + this.createdAt = createdAt; + this.expiresAt = expiresAt; + this.authToken = authToken; + this.newRegistration = newRegistration; + } + + public GetTokenResponseBody() { + 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()); } - public Optional> errors() { - return errors; + /** + * PinID for use with authentication + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional product() { + return (Optional) product; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional trusted() { + return (Optional) trusted; + } + + /** + * a link to a QR code hosted on plex.tv + * The QR code redirects to the relevant `plex.tv/link` authentication page + * Which then prompts the user for the 4 Digit Link Pin + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional qr() { + return (Optional) qr; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional clientIdentifier() { + return (Optional) clientIdentifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional location() { + return (Optional) location; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional expiresIn() { + return (Optional) expiresIn; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional expiresAt() { + return (Optional) expiresAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional authToken() { + return (Optional) authToken; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional newRegistration() { + return (Optional) newRegistration; } public final static Builder builder() { return new Builder(); } - public GetTokenResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); + /** + * PinID for use with authentication + */ + public GetTokenResponseBody withId(double id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); return this; } - public GetTokenResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; + /** + * PinID for use with authentication + */ + public GetTokenResponseBody withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetTokenResponseBody withCode(String code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public GetTokenResponseBody withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public GetTokenResponseBody withProduct(String product) { + Utils.checkNotNull(product, "product"); + this.product = Optional.ofNullable(product); + return this; + } + + public GetTokenResponseBody withProduct(Optional product) { + Utils.checkNotNull(product, "product"); + this.product = product; + return this; + } + + public GetTokenResponseBody withTrusted(boolean trusted) { + Utils.checkNotNull(trusted, "trusted"); + this.trusted = Optional.ofNullable(trusted); + return this; + } + + public GetTokenResponseBody withTrusted(Optional trusted) { + Utils.checkNotNull(trusted, "trusted"); + this.trusted = trusted; + return this; + } + + /** + * a link to a QR code hosted on plex.tv + * The QR code redirects to the relevant `plex.tv/link` authentication page + * Which then prompts the user for the 4 Digit Link Pin + * + */ + public GetTokenResponseBody withQr(String qr) { + Utils.checkNotNull(qr, "qr"); + this.qr = Optional.ofNullable(qr); + return this; + } + + /** + * a link to a QR code hosted on plex.tv + * The QR code redirects to the relevant `plex.tv/link` authentication page + * Which then prompts the user for the 4 Digit Link Pin + * + */ + public GetTokenResponseBody withQr(Optional qr) { + Utils.checkNotNull(qr, "qr"); + this.qr = qr; + return this; + } + + public GetTokenResponseBody withClientIdentifier(String clientIdentifier) { + Utils.checkNotNull(clientIdentifier, "clientIdentifier"); + this.clientIdentifier = Optional.ofNullable(clientIdentifier); + return this; + } + + public GetTokenResponseBody withClientIdentifier(Optional clientIdentifier) { + Utils.checkNotNull(clientIdentifier, "clientIdentifier"); + this.clientIdentifier = clientIdentifier; + return this; + } + + public GetTokenResponseBody withLocation(GetTokenLocation location) { + Utils.checkNotNull(location, "location"); + this.location = Optional.ofNullable(location); + return this; + } + + public GetTokenResponseBody withLocation(Optional location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + public GetTokenResponseBody withExpiresIn(double expiresIn) { + Utils.checkNotNull(expiresIn, "expiresIn"); + this.expiresIn = Optional.ofNullable(expiresIn); + return this; + } + + public GetTokenResponseBody withExpiresIn(Optional expiresIn) { + Utils.checkNotNull(expiresIn, "expiresIn"); + this.expiresIn = expiresIn; + return this; + } + + public GetTokenResponseBody withCreatedAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + public GetTokenResponseBody withCreatedAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public GetTokenResponseBody withExpiresAt(OffsetDateTime expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + public GetTokenResponseBody withExpiresAt(Optional expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = expiresAt; + return this; + } + + public GetTokenResponseBody withAuthToken(String authToken) { + Utils.checkNotNull(authToken, "authToken"); + this.authToken = Optional.ofNullable(authToken); + return this; + } + + public GetTokenResponseBody withAuthToken(Optional authToken) { + Utils.checkNotNull(authToken, "authToken"); + this.authToken = authToken; + return this; + } + + public GetTokenResponseBody withNewRegistration(String newRegistration) { + Utils.checkNotNull(newRegistration, "newRegistration"); + this.newRegistration = Optional.ofNullable(newRegistration); + return this; + } + + public GetTokenResponseBody withNewRegistration(Optional newRegistration) { + Utils.checkNotNull(newRegistration, "newRegistration"); + this.newRegistration = newRegistration; return this; } @@ -62,44 +384,260 @@ public class GetTokenResponseBody { } GetTokenResponseBody other = (GetTokenResponseBody) o; return - java.util.Objects.deepEquals(this.errors, other.errors); + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.product, other.product) && + java.util.Objects.deepEquals(this.trusted, other.trusted) && + java.util.Objects.deepEquals(this.qr, other.qr) && + java.util.Objects.deepEquals(this.clientIdentifier, other.clientIdentifier) && + java.util.Objects.deepEquals(this.location, other.location) && + java.util.Objects.deepEquals(this.expiresIn, other.expiresIn) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.expiresAt, other.expiresAt) && + java.util.Objects.deepEquals(this.authToken, other.authToken) && + java.util.Objects.deepEquals(this.newRegistration, other.newRegistration); } @Override public int hashCode() { return java.util.Objects.hash( - errors); + id, + code, + product, + trusted, + qr, + clientIdentifier, + location, + expiresIn, + createdAt, + expiresAt, + authToken, + newRegistration); } @Override public String toString() { return Utils.toString(GetTokenResponseBody.class, - "errors", errors); + "id", id, + "code", code, + "product", product, + "trusted", trusted, + "qr", qr, + "clientIdentifier", clientIdentifier, + "location", location, + "expiresIn", expiresIn, + "createdAt", createdAt, + "expiresAt", expiresAt, + "authToken", authToken, + "newRegistration", newRegistration); } public final static class Builder { - private Optional> errors = Optional.empty(); + private Optional id = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional product = Optional.empty(); + + private Optional trusted = Optional.empty(); + + private Optional qr = Optional.empty(); + + private Optional clientIdentifier = Optional.empty(); + + private Optional location = Optional.empty(); + + private Optional expiresIn = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional authToken = Optional.empty(); + + private Optional newRegistration = Optional.empty(); private Builder() { // force use of static builder() method } - public Builder errors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); + /** + * PinID for use with authentication + */ + public Builder id(double id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); return this; } - public Builder errors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; + /** + * PinID for use with authentication + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder code(String 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 product(String product) { + Utils.checkNotNull(product, "product"); + this.product = Optional.ofNullable(product); + return this; + } + + public Builder product(Optional product) { + Utils.checkNotNull(product, "product"); + this.product = product; + return this; + } + + public Builder trusted(boolean trusted) { + Utils.checkNotNull(trusted, "trusted"); + this.trusted = Optional.ofNullable(trusted); + return this; + } + + public Builder trusted(Optional trusted) { + Utils.checkNotNull(trusted, "trusted"); + this.trusted = trusted; + return this; + } + + /** + * a link to a QR code hosted on plex.tv + * The QR code redirects to the relevant `plex.tv/link` authentication page + * Which then prompts the user for the 4 Digit Link Pin + * + */ + public Builder qr(String qr) { + Utils.checkNotNull(qr, "qr"); + this.qr = Optional.ofNullable(qr); + return this; + } + + /** + * a link to a QR code hosted on plex.tv + * The QR code redirects to the relevant `plex.tv/link` authentication page + * Which then prompts the user for the 4 Digit Link Pin + * + */ + public Builder qr(Optional qr) { + Utils.checkNotNull(qr, "qr"); + this.qr = qr; + return this; + } + + public Builder clientIdentifier(String clientIdentifier) { + Utils.checkNotNull(clientIdentifier, "clientIdentifier"); + this.clientIdentifier = Optional.ofNullable(clientIdentifier); + return this; + } + + public Builder clientIdentifier(Optional clientIdentifier) { + Utils.checkNotNull(clientIdentifier, "clientIdentifier"); + this.clientIdentifier = clientIdentifier; + return this; + } + + public Builder location(GetTokenLocation location) { + Utils.checkNotNull(location, "location"); + this.location = Optional.ofNullable(location); + return this; + } + + public Builder location(Optional location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + public Builder expiresIn(double expiresIn) { + Utils.checkNotNull(expiresIn, "expiresIn"); + this.expiresIn = Optional.ofNullable(expiresIn); + return this; + } + + public Builder expiresIn(Optional expiresIn) { + Utils.checkNotNull(expiresIn, "expiresIn"); + this.expiresIn = expiresIn; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + public Builder createdAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + public Builder expiresAt(Optional expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = expiresAt; + return this; + } + + public Builder authToken(String authToken) { + Utils.checkNotNull(authToken, "authToken"); + this.authToken = Optional.ofNullable(authToken); + return this; + } + + public Builder authToken(Optional authToken) { + Utils.checkNotNull(authToken, "authToken"); + this.authToken = authToken; + return this; + } + + public Builder newRegistration(String newRegistration) { + Utils.checkNotNull(newRegistration, "newRegistration"); + this.newRegistration = Optional.ofNullable(newRegistration); + return this; + } + + public Builder newRegistration(Optional newRegistration) { + Utils.checkNotNull(newRegistration, "newRegistration"); + this.newRegistration = newRegistration; return this; } public GetTokenResponseBody build() { return new GetTokenResponseBody( - errors); + id, + code, + product, + trusted, + qr, + clientIdentifier, + location, + expiresIn, + createdAt, + expiresAt, + authToken, + newRegistration); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentCountry.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentCountry.java new file mode 100644 index 00000000..b02a3bcd --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentCountry.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public GetTopWatchedContentCountry( + @JsonProperty("id") Optional id, + @JsonProperty("filter") Optional filter, + @JsonProperty("tag") Optional tag) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(filter, "filter"); + Utils.checkNotNull(tag, "tag"); + this.id = id; + this.filter = filter; + this.tag = tag; + } + + public GetTopWatchedContentCountry() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetTopWatchedContentCountry withId(int id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public GetTopWatchedContentCountry withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetTopWatchedContentCountry withFilter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + public GetTopWatchedContentCountry withFilter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public GetTopWatchedContentCountry withTag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentCountry other = (GetTopWatchedContentCountry) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.filter, other.filter) && + java.util.Objects.deepEquals(this.tag, other.tag); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + filter, + tag); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentCountry.class, + "id", id, + "filter", filter, + "tag", tag); + } + + 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); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder filter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + public Builder filter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public Builder tag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public Builder tag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + public GetTopWatchedContentCountry build() { + return new GetTopWatchedContentCountry( + id, + filter, + tag); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentGenre.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentGenre.java new file mode 100644 index 00000000..ac3e50ff --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentGenre.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public GetTopWatchedContentGenre( + @JsonProperty("id") Optional id, + @JsonProperty("filter") Optional filter, + @JsonProperty("tag") Optional tag) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(filter, "filter"); + Utils.checkNotNull(tag, "tag"); + this.id = id; + this.filter = filter; + this.tag = tag; + } + + public GetTopWatchedContentGenre() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetTopWatchedContentGenre withId(int id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public GetTopWatchedContentGenre withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetTopWatchedContentGenre withFilter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + public GetTopWatchedContentGenre withFilter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public GetTopWatchedContentGenre withTag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentGenre other = (GetTopWatchedContentGenre) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.filter, other.filter) && + java.util.Objects.deepEquals(this.tag, other.tag); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + filter, + tag); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentGenre.class, + "id", id, + "filter", filter, + "tag", tag); + } + + 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); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder filter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + public Builder filter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public Builder tag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public Builder tag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + public GetTopWatchedContentGenre build() { + return new GetTopWatchedContentGenre( + id, + filter, + tag); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentGuids.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentGuids.java new file mode 100644 index 00000000..c6334606 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentGuids.java @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetTopWatchedContentGuids { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonCreator + public GetTopWatchedContentGuids( + @JsonProperty("id") Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + } + + public GetTopWatchedContentGuids() { + this(Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetTopWatchedContentGuids withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentGuids other = (GetTopWatchedContentGuids) o; + return + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentGuids.class, + "id", id); + } + + 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); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetTopWatchedContentGuids build() { + return new GetTopWatchedContentGuids( + id); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentMediaContainer.java new file mode 100644 index 00000000..fe840b18 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentMediaContainer.java @@ -0,0 +1,326 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetTopWatchedContentMediaContainer { + + @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("Metadata") + private Optional> metadata; + + @JsonCreator + public GetTopWatchedContentMediaContainer( + @JsonProperty("size") Optional size, + @JsonProperty("allowSync") Optional allowSync, + @JsonProperty("identifier") Optional identifier, + @JsonProperty("mediaTagPrefix") Optional mediaTagPrefix, + @JsonProperty("mediaTagVersion") Optional mediaTagVersion, + @JsonProperty("Metadata") Optional> metadata) { + Utils.checkNotNull(size, "size"); + Utils.checkNotNull(allowSync, "allowSync"); + Utils.checkNotNull(identifier, "identifier"); + Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); + Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); + Utils.checkNotNull(metadata, "metadata"); + this.size = size; + this.allowSync = allowSync; + this.identifier = identifier; + this.mediaTagPrefix = mediaTagPrefix; + this.mediaTagVersion = mediaTagVersion; + this.metadata = metadata; + } + + public GetTopWatchedContentMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagPrefix() { + return (Optional) mediaTagPrefix; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagVersion() { + return (Optional) mediaTagVersion; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetTopWatchedContentMediaContainer withSize(int size) { + Utils.checkNotNull(size, "size"); + this.size = Optional.ofNullable(size); + return this; + } + + public GetTopWatchedContentMediaContainer withSize(Optional size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + public GetTopWatchedContentMediaContainer withAllowSync(boolean allowSync) { + Utils.checkNotNull(allowSync, "allowSync"); + this.allowSync = Optional.ofNullable(allowSync); + return this; + } + + public GetTopWatchedContentMediaContainer withAllowSync(Optional allowSync) { + Utils.checkNotNull(allowSync, "allowSync"); + this.allowSync = allowSync; + return this; + } + + public GetTopWatchedContentMediaContainer withIdentifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = Optional.ofNullable(identifier); + return this; + } + + public GetTopWatchedContentMediaContainer withIdentifier(Optional identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + public GetTopWatchedContentMediaContainer withMediaTagPrefix(String mediaTagPrefix) { + Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); + this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix); + return this; + } + + public GetTopWatchedContentMediaContainer withMediaTagPrefix(Optional mediaTagPrefix) { + Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); + this.mediaTagPrefix = mediaTagPrefix; + return this; + } + + public GetTopWatchedContentMediaContainer withMediaTagVersion(int mediaTagVersion) { + Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); + this.mediaTagVersion = Optional.ofNullable(mediaTagVersion); + return this; + } + + public GetTopWatchedContentMediaContainer withMediaTagVersion(Optional mediaTagVersion) { + Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); + this.mediaTagVersion = mediaTagVersion; + return this; + } + + public GetTopWatchedContentMediaContainer withMetadata(java.util.List metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentMediaContainer other = (GetTopWatchedContentMediaContainer) o; + return + java.util.Objects.deepEquals(this.size, other.size) && + java.util.Objects.deepEquals(this.allowSync, other.allowSync) && + java.util.Objects.deepEquals(this.identifier, other.identifier) && + java.util.Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + java.util.Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && + java.util.Objects.deepEquals(this.metadata, other.metadata); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + size, + allowSync, + identifier, + mediaTagPrefix, + mediaTagVersion, + metadata); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentMediaContainer.class, + "size", size, + "allowSync", allowSync, + "identifier", identifier, + "mediaTagPrefix", mediaTagPrefix, + "mediaTagVersion", mediaTagVersion, + "metadata", metadata); + } + + public final static class Builder { + + 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> 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); + return this; + } + + public Builder size(Optional size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + public Builder allowSync(boolean allowSync) { + Utils.checkNotNull(allowSync, "allowSync"); + this.allowSync = Optional.ofNullable(allowSync); + return this; + } + + public Builder allowSync(Optional allowSync) { + Utils.checkNotNull(allowSync, "allowSync"); + this.allowSync = allowSync; + return this; + } + + public Builder identifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = Optional.ofNullable(identifier); + return this; + } + + public Builder identifier(Optional identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + public Builder mediaTagPrefix(String mediaTagPrefix) { + Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); + this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix); + return this; + } + + public Builder mediaTagPrefix(Optional mediaTagPrefix) { + Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); + this.mediaTagPrefix = mediaTagPrefix; + return this; + } + + public Builder mediaTagVersion(int mediaTagVersion) { + Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); + this.mediaTagVersion = Optional.ofNullable(mediaTagVersion); + return this; + } + + public Builder mediaTagVersion(Optional mediaTagVersion) { + Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); + this.mediaTagVersion = mediaTagVersion; + return this; + } + + public Builder metadata(java.util.List metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public GetTopWatchedContentMediaContainer build() { + return new GetTopWatchedContentMediaContainer( + size, + allowSync, + identifier, + mediaTagPrefix, + mediaTagVersion, + metadata); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentMetadata.java new file mode 100644 index 00000000..22ce063a --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentMetadata.java @@ -0,0 +1,1445 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public GetTopWatchedContentMetadata( + @JsonProperty("ratingKey") Optional ratingKey, + @JsonProperty("key") Optional key, + @JsonProperty("guid") Optional guid, + @JsonProperty("slug") Optional slug, + @JsonProperty("studio") Optional studio, + @JsonProperty("type") Optional type, + @JsonProperty("title") Optional title, + @JsonProperty("librarySectionTitle") Optional librarySectionTitle, + @JsonProperty("librarySectionID") Optional librarySectionID, + @JsonProperty("librarySectionKey") Optional librarySectionKey, + @JsonProperty("contentRating") Optional contentRating, + @JsonProperty("summary") Optional summary, + @JsonProperty("index") Optional index, + @JsonProperty("audienceRating") Optional audienceRating, + @JsonProperty("year") Optional year, + @JsonProperty("tagline") Optional tagline, + @JsonProperty("thumb") Optional thumb, + @JsonProperty("art") Optional art, + @JsonProperty("duration") Optional duration, + @JsonProperty("originallyAvailableAt") Optional originallyAvailableAt, + @JsonProperty("leafCount") Optional leafCount, + @JsonProperty("viewedLeafCount") Optional viewedLeafCount, + @JsonProperty("childCount") Optional childCount, + @JsonProperty("addedAt") Optional addedAt, + @JsonProperty("updatedAt") Optional updatedAt, + @JsonProperty("globalViewCount") Optional globalViewCount, + @JsonProperty("audienceRatingImage") Optional audienceRatingImage, + @JsonProperty("Genre") Optional> genre, + @JsonProperty("Country") Optional> country, + @JsonProperty("guids") Optional> guids, + @JsonProperty("Role") Optional> role, + @JsonProperty("User") Optional> user) { + Utils.checkNotNull(ratingKey, "ratingKey"); + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(guid, "guid"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(studio, "studio"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(title, "title"); + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + Utils.checkNotNull(librarySectionID, "librarySectionID"); + Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + Utils.checkNotNull(contentRating, "contentRating"); + Utils.checkNotNull(summary, "summary"); + Utils.checkNotNull(index, "index"); + Utils.checkNotNull(audienceRating, "audienceRating"); + Utils.checkNotNull(year, "year"); + Utils.checkNotNull(tagline, "tagline"); + Utils.checkNotNull(thumb, "thumb"); + Utils.checkNotNull(art, "art"); + Utils.checkNotNull(duration, "duration"); + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + Utils.checkNotNull(leafCount, "leafCount"); + Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); + Utils.checkNotNull(childCount, "childCount"); + Utils.checkNotNull(addedAt, "addedAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(globalViewCount, "globalViewCount"); + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + Utils.checkNotNull(genre, "genre"); + Utils.checkNotNull(country, "country"); + Utils.checkNotNull(guids, "guids"); + Utils.checkNotNull(role, "role"); + Utils.checkNotNull(user, "user"); + this.ratingKey = ratingKey; + this.key = key; + this.guid = guid; + this.slug = slug; + this.studio = studio; + this.type = type; + this.title = title; + this.librarySectionTitle = librarySectionTitle; + this.librarySectionID = librarySectionID; + this.librarySectionKey = librarySectionKey; + this.contentRating = contentRating; + this.summary = summary; + this.index = index; + this.audienceRating = audienceRating; + this.year = year; + this.tagline = tagline; + this.thumb = thumb; + this.art = art; + this.duration = duration; + this.originallyAvailableAt = originallyAvailableAt; + this.leafCount = leafCount; + this.viewedLeafCount = viewedLeafCount; + this.childCount = childCount; + this.addedAt = addedAt; + this.updatedAt = updatedAt; + this.globalViewCount = globalViewCount; + this.audienceRatingImage = audienceRatingImage; + this.genre = genre; + this.country = country; + this.guids = guids; + this.role = role; + this.user = user; + } + + 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()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional slug() { + return (Optional) slug; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional studio() { + return (Optional) studio; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionKey() { + return (Optional) librarySectionKey; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional contentRating() { + return (Optional) contentRating; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional index() { + return (Optional) index; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRating() { + return (Optional) audienceRating; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional year() { + return (Optional) year; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagline() { + return (Optional) tagline; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originallyAvailableAt() { + return (Optional) originallyAvailableAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewedLeafCount() { + return (Optional) viewedLeafCount; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional childCount() { + return (Optional) childCount; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional globalViewCount() { + return (Optional) globalViewCount; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRatingImage() { + return (Optional) audienceRatingImage; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> genre() { + return (Optional>) genre; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> country() { + return (Optional>) country; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> guids() { + return (Optional>) guids; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> role() { + return (Optional>) role; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> user() { + return (Optional>) user; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetTopWatchedContentMetadata withRatingKey(String ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = Optional.ofNullable(ratingKey); + return this; + } + + public GetTopWatchedContentMetadata withRatingKey(Optional ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + public GetTopWatchedContentMetadata withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = Optional.ofNullable(key); + return this; + } + + public GetTopWatchedContentMetadata withKey(Optional key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetTopWatchedContentMetadata withGuid(String guid) { + Utils.checkNotNull(guid, "guid"); + this.guid = Optional.ofNullable(guid); + return this; + } + + public GetTopWatchedContentMetadata withGuid(Optional guid) { + Utils.checkNotNull(guid, "guid"); + this.guid = guid; + return this; + } + + public GetTopWatchedContentMetadata withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + public GetTopWatchedContentMetadata withSlug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public GetTopWatchedContentMetadata withStudio(String studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = Optional.ofNullable(studio); + return this; + } + + public GetTopWatchedContentMetadata withStudio(Optional studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = studio; + return this; + } + + public GetTopWatchedContentMetadata withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + public GetTopWatchedContentMetadata withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetTopWatchedContentMetadata withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.ofNullable(title); + return this; + } + + public GetTopWatchedContentMetadata withTitle(Optional title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public GetTopWatchedContentMetadata withLibrarySectionTitle(String librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); + return this; + } + + public GetTopWatchedContentMetadata withLibrarySectionTitle(Optional librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = librarySectionTitle; + return this; + } + + public GetTopWatchedContentMetadata withLibrarySectionID(int librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = Optional.ofNullable(librarySectionID); + return this; + } + + public GetTopWatchedContentMetadata withLibrarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + public GetTopWatchedContentMetadata withLibrarySectionKey(String librarySectionKey) { + Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + this.librarySectionKey = Optional.ofNullable(librarySectionKey); + return this; + } + + public GetTopWatchedContentMetadata withLibrarySectionKey(Optional librarySectionKey) { + Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + this.librarySectionKey = librarySectionKey; + return this; + } + + public GetTopWatchedContentMetadata withContentRating(String contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = Optional.ofNullable(contentRating); + return this; + } + + public GetTopWatchedContentMetadata withContentRating(Optional contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = contentRating; + return this; + } + + public GetTopWatchedContentMetadata withSummary(String summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = Optional.ofNullable(summary); + return this; + } + + public GetTopWatchedContentMetadata withSummary(Optional summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = summary; + return this; + } + + public GetTopWatchedContentMetadata withIndex(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + public GetTopWatchedContentMetadata withIndex(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + public GetTopWatchedContentMetadata withAudienceRating(double audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = Optional.ofNullable(audienceRating); + return this; + } + + public GetTopWatchedContentMetadata withAudienceRating(Optional audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = audienceRating; + return this; + } + + public GetTopWatchedContentMetadata withYear(int year) { + Utils.checkNotNull(year, "year"); + this.year = Optional.ofNullable(year); + return this; + } + + public GetTopWatchedContentMetadata withYear(Optional year) { + Utils.checkNotNull(year, "year"); + this.year = year; + return this; + } + + public GetTopWatchedContentMetadata withTagline(String tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = Optional.ofNullable(tagline); + return this; + } + + public GetTopWatchedContentMetadata withTagline(Optional tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = tagline; + return this; + } + + public GetTopWatchedContentMetadata withThumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public GetTopWatchedContentMetadata withThumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public GetTopWatchedContentMetadata withArt(String art) { + Utils.checkNotNull(art, "art"); + this.art = Optional.ofNullable(art); + return this; + } + + public GetTopWatchedContentMetadata withArt(Optional art) { + Utils.checkNotNull(art, "art"); + this.art = art; + return this; + } + + public GetTopWatchedContentMetadata withDuration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public GetTopWatchedContentMetadata withDuration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public GetTopWatchedContentMetadata withOriginallyAvailableAt(LocalDate originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); + return this; + } + + public GetTopWatchedContentMetadata withOriginallyAvailableAt(Optional originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = originallyAvailableAt; + return this; + } + + public GetTopWatchedContentMetadata withLeafCount(long leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = Optional.ofNullable(leafCount); + return this; + } + + public GetTopWatchedContentMetadata withLeafCount(Optional leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = leafCount; + return this; + } + + public GetTopWatchedContentMetadata withViewedLeafCount(long viewedLeafCount) { + Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); + this.viewedLeafCount = Optional.ofNullable(viewedLeafCount); + return this; + } + + public GetTopWatchedContentMetadata withViewedLeafCount(Optional viewedLeafCount) { + Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); + this.viewedLeafCount = viewedLeafCount; + return this; + } + + public GetTopWatchedContentMetadata withChildCount(long childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = Optional.ofNullable(childCount); + return this; + } + + public GetTopWatchedContentMetadata withChildCount(Optional childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = childCount; + return this; + } + + public GetTopWatchedContentMetadata withAddedAt(int addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = Optional.ofNullable(addedAt); + return this; + } + + public GetTopWatchedContentMetadata withAddedAt(Optional addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = addedAt; + return this; + } + + public GetTopWatchedContentMetadata withUpdatedAt(int updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public GetTopWatchedContentMetadata withUpdatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public GetTopWatchedContentMetadata withGlobalViewCount(long globalViewCount) { + Utils.checkNotNull(globalViewCount, "globalViewCount"); + this.globalViewCount = Optional.ofNullable(globalViewCount); + return this; + } + + public GetTopWatchedContentMetadata withGlobalViewCount(Optional globalViewCount) { + Utils.checkNotNull(globalViewCount, "globalViewCount"); + this.globalViewCount = globalViewCount; + return this; + } + + public GetTopWatchedContentMetadata withAudienceRatingImage(String audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); + return this; + } + + public GetTopWatchedContentMetadata withAudienceRatingImage(Optional audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = audienceRatingImage; + return this; + } + + public GetTopWatchedContentMetadata withGenre(java.util.List genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = Optional.ofNullable(genre); + return this; + } + + public GetTopWatchedContentMetadata withGenre(Optional> genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = genre; + return this; + } + + public GetTopWatchedContentMetadata withCountry(java.util.List country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + public GetTopWatchedContentMetadata withCountry(Optional> country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + public GetTopWatchedContentMetadata withGuids(java.util.List guids) { + Utils.checkNotNull(guids, "guids"); + this.guids = Optional.ofNullable(guids); + return this; + } + + public GetTopWatchedContentMetadata withGuids(Optional> guids) { + Utils.checkNotNull(guids, "guids"); + this.guids = guids; + return this; + } + + public GetTopWatchedContentMetadata withRole(java.util.List role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public GetTopWatchedContentMetadata withRole(Optional> role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public GetTopWatchedContentMetadata withUser(java.util.List user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentMetadata other = (GetTopWatchedContentMetadata) o; + return + java.util.Objects.deepEquals(this.ratingKey, other.ratingKey) && + java.util.Objects.deepEquals(this.key, other.key) && + java.util.Objects.deepEquals(this.guid, other.guid) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.studio, other.studio) && + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.title, other.title) && + java.util.Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && + java.util.Objects.deepEquals(this.librarySectionID, other.librarySectionID) && + java.util.Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && + java.util.Objects.deepEquals(this.contentRating, other.contentRating) && + java.util.Objects.deepEquals(this.summary, other.summary) && + java.util.Objects.deepEquals(this.index, other.index) && + java.util.Objects.deepEquals(this.audienceRating, other.audienceRating) && + java.util.Objects.deepEquals(this.year, other.year) && + java.util.Objects.deepEquals(this.tagline, other.tagline) && + java.util.Objects.deepEquals(this.thumb, other.thumb) && + java.util.Objects.deepEquals(this.art, other.art) && + java.util.Objects.deepEquals(this.duration, other.duration) && + java.util.Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + java.util.Objects.deepEquals(this.leafCount, other.leafCount) && + java.util.Objects.deepEquals(this.viewedLeafCount, other.viewedLeafCount) && + java.util.Objects.deepEquals(this.childCount, other.childCount) && + java.util.Objects.deepEquals(this.addedAt, other.addedAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt) && + java.util.Objects.deepEquals(this.globalViewCount, other.globalViewCount) && + java.util.Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && + java.util.Objects.deepEquals(this.genre, other.genre) && + java.util.Objects.deepEquals(this.country, other.country) && + java.util.Objects.deepEquals(this.guids, other.guids) && + java.util.Objects.deepEquals(this.role, other.role) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.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); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentMetadata.class, + "ratingKey", ratingKey, + "key", key, + "guid", guid, + "slug", slug, + "studio", studio, + "type", type, + "title", title, + "librarySectionTitle", librarySectionTitle, + "librarySectionID", librarySectionID, + "librarySectionKey", librarySectionKey, + "contentRating", contentRating, + "summary", summary, + "index", index, + "audienceRating", audienceRating, + "year", year, + "tagline", tagline, + "thumb", thumb, + "art", art, + "duration", duration, + "originallyAvailableAt", originallyAvailableAt, + "leafCount", leafCount, + "viewedLeafCount", viewedLeafCount, + "childCount", childCount, + "addedAt", addedAt, + "updatedAt", updatedAt, + "globalViewCount", globalViewCount, + "audienceRatingImage", audienceRatingImage, + "genre", genre, + "country", country, + "guids", guids, + "role", role, + "user", user); + } + + 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); + return this; + } + + public Builder ratingKey(Optional ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = Optional.ofNullable(key); + return this; + } + + public Builder key(Optional key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder guid(String guid) { + Utils.checkNotNull(guid, "guid"); + this.guid = Optional.ofNullable(guid); + return this; + } + + public Builder guid(Optional guid) { + Utils.checkNotNull(guid, "guid"); + this.guid = guid; + return this; + } + + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + public Builder slug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Builder studio(String studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = Optional.ofNullable(studio); + return this; + } + + public Builder studio(Optional studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = studio; + return this; + } + + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.ofNullable(title); + return this; + } + + public Builder title(Optional title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public Builder librarySectionTitle(String librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); + return this; + } + + public Builder librarySectionTitle(Optional librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = librarySectionTitle; + return this; + } + + public Builder librarySectionID(int librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = Optional.ofNullable(librarySectionID); + return this; + } + + public Builder librarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + public Builder librarySectionKey(String librarySectionKey) { + Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + this.librarySectionKey = Optional.ofNullable(librarySectionKey); + return this; + } + + public Builder librarySectionKey(Optional librarySectionKey) { + Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + this.librarySectionKey = librarySectionKey; + return this; + } + + public Builder contentRating(String contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = Optional.ofNullable(contentRating); + return this; + } + + public Builder contentRating(Optional contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = contentRating; + return this; + } + + public Builder summary(String summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = Optional.ofNullable(summary); + return this; + } + + public Builder summary(Optional summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = summary; + return this; + } + + public Builder index(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + public Builder index(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + public Builder audienceRating(double audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = Optional.ofNullable(audienceRating); + return this; + } + + public Builder audienceRating(Optional audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = audienceRating; + return this; + } + + public Builder year(int year) { + Utils.checkNotNull(year, "year"); + this.year = Optional.ofNullable(year); + return this; + } + + public Builder year(Optional year) { + Utils.checkNotNull(year, "year"); + this.year = year; + return this; + } + + public Builder tagline(String tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = Optional.ofNullable(tagline); + return this; + } + + public Builder tagline(Optional tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = tagline; + return this; + } + + public Builder thumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public Builder thumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public Builder art(String art) { + Utils.checkNotNull(art, "art"); + this.art = Optional.ofNullable(art); + return this; + } + + public Builder art(Optional art) { + Utils.checkNotNull(art, "art"); + this.art = art; + return this; + } + + public Builder duration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Builder duration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public Builder originallyAvailableAt(LocalDate originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); + return this; + } + + public Builder originallyAvailableAt(Optional originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = originallyAvailableAt; + return this; + } + + public Builder leafCount(long leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = Optional.ofNullable(leafCount); + return this; + } + + public Builder leafCount(Optional leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = leafCount; + return this; + } + + public Builder viewedLeafCount(long viewedLeafCount) { + Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); + this.viewedLeafCount = Optional.ofNullable(viewedLeafCount); + return this; + } + + public Builder viewedLeafCount(Optional viewedLeafCount) { + Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); + this.viewedLeafCount = viewedLeafCount; + return this; + } + + public Builder childCount(long childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = Optional.ofNullable(childCount); + return this; + } + + public Builder childCount(Optional childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = childCount; + return this; + } + + public Builder addedAt(int addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = Optional.ofNullable(addedAt); + return this; + } + + public Builder addedAt(Optional addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = addedAt; + return this; + } + + public Builder updatedAt(int updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public Builder updatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public Builder globalViewCount(long globalViewCount) { + Utils.checkNotNull(globalViewCount, "globalViewCount"); + this.globalViewCount = Optional.ofNullable(globalViewCount); + return this; + } + + public Builder globalViewCount(Optional globalViewCount) { + Utils.checkNotNull(globalViewCount, "globalViewCount"); + this.globalViewCount = globalViewCount; + return this; + } + + public Builder audienceRatingImage(String audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); + return this; + } + + public Builder audienceRatingImage(Optional audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = audienceRatingImage; + return this; + } + + public Builder genre(java.util.List genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = Optional.ofNullable(genre); + return this; + } + + public Builder genre(Optional> genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = genre; + return this; + } + + public Builder country(java.util.List country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + public Builder country(Optional> country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + public Builder guids(java.util.List guids) { + Utils.checkNotNull(guids, "guids"); + this.guids = Optional.ofNullable(guids); + return this; + } + + public Builder guids(Optional> guids) { + Utils.checkNotNull(guids, "guids"); + this.guids = guids; + return this; + } + + public Builder role(java.util.List role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public Builder role(Optional> role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public Builder user(java.util.List user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + public Builder user(Optional> user) { + Utils.checkNotNull(user, "user"); + 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); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRequest.java new file mode 100644 index 00000000..b193d28d --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetTopWatchedContentRequest { + + /** + * the library type (1 - movies, 2 - shows, 3 - music) + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=type") + private long type; + + /** + * Adds the Guids object to the response + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids") + private Optional includeGuids; + + @JsonCreator + public GetTopWatchedContentRequest( + long type, + Optional includeGuids) { + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(includeGuids, "includeGuids"); + this.type = type; + this.includeGuids = includeGuids; + } + + public GetTopWatchedContentRequest( + long type) { + this(type, Optional.empty()); + } + + /** + * the library type (1 - movies, 2 - shows, 3 - music) + */ + @JsonIgnore + public long type() { + return type; + } + + /** + * Adds the Guids object to the response + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional includeGuids() { + return (Optional) includeGuids; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * the library type (1 - movies, 2 - shows, 3 - music) + */ + public GetTopWatchedContentRequest withType(long type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * Adds the Guids object to the response + * + */ + public GetTopWatchedContentRequest withIncludeGuids(long includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = Optional.ofNullable(includeGuids); + return this; + } + + /** + * Adds the Guids object to the response + * + */ + public GetTopWatchedContentRequest withIncludeGuids(Optional includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = includeGuids; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentRequest other = (GetTopWatchedContentRequest) o; + return + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.includeGuids, other.includeGuids); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + type, + includeGuids); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentRequest.class, + "type", type, + "includeGuids", includeGuids); + } + + public final static class Builder { + + private Long type; + + private Optional includeGuids = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * the library type (1 - movies, 2 - shows, 3 - music) + */ + public Builder type(long type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * Adds the Guids object to the response + * + */ + public Builder includeGuids(long includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = Optional.ofNullable(includeGuids); + return this; + } + + /** + * Adds the Guids object to the response + * + */ + public Builder includeGuids(Optional includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = includeGuids; + return this; + } + + public GetTopWatchedContentRequest build() { + return new GetTopWatchedContentRequest( + type, + includeGuids); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRequestBuilder.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRequestBuilder.java new file mode 100644 index 00000000..9eac2367 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import lukehagar.plexapi.plexapi.models.errors.SDKError; +import lukehagar.plexapi.plexapi.utils.LazySingletonValue; +import lukehagar.plexapi.plexapi.utils.Utils; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetTopWatchedContentRequestBuilder { + + private Long type; + private Optional includeGuids = Optional.empty(); + private final SDKMethodInterfaces.MethodCallGetTopWatchedContent sdk; + + public GetTopWatchedContentRequestBuilder(SDKMethodInterfaces.MethodCallGetTopWatchedContent sdk) { + this.sdk = sdk; + } + + public GetTopWatchedContentRequestBuilder type(long type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetTopWatchedContentRequestBuilder includeGuids(long 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; + } + + public GetTopWatchedContentResponse call() throws Exception { + + return sdk.getTopWatchedContent( + type, + includeGuids); + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentResponse.java new file mode 100644 index 00000000..d8a0d3bd --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetTopWatchedContentResponse implements lukehagar.plexapi.plexapi.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The 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 final 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 + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The 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/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentResponseBody.java new file mode 100644 index 00000000..da530e11 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentResponseBody.java @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; +/** + * GetTopWatchedContentResponseBody - The metadata of the library item. + */ + +public class GetTopWatchedContentResponseBody { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("MediaContainer") + private Optional mediaContainer; + + @JsonCreator + public GetTopWatchedContentResponseBody( + @JsonProperty("MediaContainer") Optional mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = mediaContainer; + } + + public GetTopWatchedContentResponseBody() { + this(Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetTopWatchedContentResponseBody withMediaContainer(GetTopWatchedContentMediaContainer mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = Optional.ofNullable(mediaContainer); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentResponseBody other = (GetTopWatchedContentResponseBody) o; + return + java.util.Objects.deepEquals(this.mediaContainer, other.mediaContainer); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + mediaContainer); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentResponseBody.class, + "mediaContainer", mediaContainer); + } + + 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); + return this; + } + + public Builder mediaContainer(Optional mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = mediaContainer; + return this; + } + + public GetTopWatchedContentResponseBody build() { + return new GetTopWatchedContentResponseBody( + mediaContainer); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRole.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRole.java new file mode 100644 index 00000000..08150776 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTopWatchedContentRole.java @@ -0,0 +1,326 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public GetTopWatchedContentRole( + @JsonProperty("id") Optional id, + @JsonProperty("filter") Optional filter, + @JsonProperty("tag") Optional tag, + @JsonProperty("tagKey") Optional tagKey, + @JsonProperty("role") Optional role, + @JsonProperty("thumb") Optional thumb) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(filter, "filter"); + Utils.checkNotNull(tag, "tag"); + Utils.checkNotNull(tagKey, "tagKey"); + Utils.checkNotNull(role, "role"); + Utils.checkNotNull(thumb, "thumb"); + this.id = id; + this.filter = filter; + this.tag = tag; + this.tagKey = tagKey; + this.role = role; + this.thumb = thumb; + } + + public GetTopWatchedContentRole() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagKey() { + return (Optional) tagKey; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional role() { + return (Optional) role; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetTopWatchedContentRole withId(int id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public GetTopWatchedContentRole withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetTopWatchedContentRole withFilter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + public GetTopWatchedContentRole withFilter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public GetTopWatchedContentRole withTag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public GetTopWatchedContentRole withTag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + public GetTopWatchedContentRole withTagKey(String tagKey) { + Utils.checkNotNull(tagKey, "tagKey"); + this.tagKey = Optional.ofNullable(tagKey); + return this; + } + + public GetTopWatchedContentRole withTagKey(Optional tagKey) { + Utils.checkNotNull(tagKey, "tagKey"); + this.tagKey = tagKey; + return this; + } + + public GetTopWatchedContentRole withRole(String role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public GetTopWatchedContentRole withRole(Optional role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public GetTopWatchedContentRole withThumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentRole other = (GetTopWatchedContentRole) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.filter, other.filter) && + java.util.Objects.deepEquals(this.tag, other.tag) && + java.util.Objects.deepEquals(this.tagKey, other.tagKey) && + java.util.Objects.deepEquals(this.role, other.role) && + java.util.Objects.deepEquals(this.thumb, other.thumb); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + filter, + tag, + tagKey, + role, + thumb); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentRole.class, + "id", id, + "filter", filter, + "tag", tag, + "tagKey", tagKey, + "role", role, + "thumb", thumb); + } + + 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); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder filter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + public Builder filter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public Builder tag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public Builder tag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + public Builder tagKey(String tagKey) { + Utils.checkNotNull(tagKey, "tagKey"); + this.tagKey = Optional.ofNullable(tagKey); + return this; + } + + public Builder tagKey(Optional tagKey) { + Utils.checkNotNull(tagKey, "tagKey"); + this.tagKey = tagKey; + return this; + } + + public Builder role(String role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public Builder role(Optional role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public Builder thumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public Builder thumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public GetTopWatchedContentRole build() { + return new GetTopWatchedContentRole( + id, + filter, + tag, + tagKey, + role, + thumb); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsMediaContainer.java index 3f80b141..4b25b246 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTranscodeSessionsMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class GetTranscodeSessionsMediaContainer { @JsonProperty("TranscodeSession") private Optional> transcodeSession; + @JsonCreator public GetTranscodeSessionsMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("TranscodeSession") Optional> transcodeSession) { @@ -35,13 +37,21 @@ public class GetTranscodeSessionsMediaContainer { this.size = size; this.transcodeSession = transcodeSession; } - - public Optional size() { - return size; + + public GetTranscodeSessionsMediaContainer() { + this(Optional.empty(), Optional.empty()); } - public Optional> transcodeSession() { - return transcodeSession; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> transcodeSession() { + return (Optional>) transcodeSession; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsResponse.java index 65eb5cda..d5c9f72c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u /** * The Transcode Sessions */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetTranscodeSessionsResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u /** * The Transcode Sessions */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u /** * The Transcode Sessions */ - public GetTranscodeSessionsResponse withTwoHundredApplicationJsonObject(GetTranscodeSessionsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetTranscodeSessionsResponse withObject(GetTranscodeSessionsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Transcode Sessions */ - public GetTranscodeSessionsResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetTranscodeSessionsResponse withFourHundredAndOneApplicationJsonObject(GetTranscodeSessionsSessionsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetTranscodeSessionsResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetTranscodeSessionsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u /** * The Transcode Sessions */ - public Builder twoHundredApplicationJsonObject(GetTranscodeSessionsResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetTranscodeSessionsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Transcode Sessions */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetTranscodeSessionsSessionsResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetTranscodeSessionsResponse implements lukehagar.plexapi.plexapi.u contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsResponseBody.java index 5300658e..c8813eae 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetTranscodeSessionsResponseBody - The Transcode Sessions */ @@ -26,14 +27,21 @@ public class GetTranscodeSessionsResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetTranscodeSessionsResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetTranscodeSessionsResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsSessionsResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsSessionsResponseBody.java deleted file mode 100644 index d535fc76..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTranscodeSessionsSessionsResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetTranscodeSessionsSessionsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetTranscodeSessionsSessionsResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetTranscodeSessionsSessionsResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetTranscodeSessionsSessionsResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetTranscodeSessionsSessionsResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTranscodeSessionsSessionsResponseBody other = (GetTranscodeSessionsSessionsResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetTranscodeSessionsSessionsResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetTranscodeSessionsSessionsResponseBody build() { - return new GetTranscodeSessionsSessionsResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenQueryParamType.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenQueryParamType.java index 7dbc9fe5..09276b7f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenQueryParamType.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenQueryParamType.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenRequest.java index 448538a3..64495323 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTransientTokenRequest { /** @@ -28,6 +29,7 @@ public class GetTransientTokenRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=scope") private Scope scope; + @JsonCreator public GetTransientTokenRequest( GetTransientTokenQueryParamType type, Scope scope) { @@ -40,6 +42,7 @@ public class GetTransientTokenRequest { /** * `delegation` - This is the only supported `type` parameter. */ + @JsonIgnore public GetTransientTokenQueryParamType type() { return type; } @@ -47,6 +50,7 @@ public class GetTransientTokenRequest { /** * `all` - This is the only supported `scope` parameter. */ + @JsonIgnore public Scope scope() { return scope; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenResponse.java index e9406f7e..9c06af81 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetTransientTokenResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetTransientTokenResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class GetTransientTokenResponse implements lukehagar.plexapi.plexapi.util */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public GetTransientTokenResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class GetTransientTokenResponse implements lukehagar.plexapi.plexapi.util /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class GetTransientTokenResponse implements lukehagar.plexapi.plexapi.util /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class GetTransientTokenResponse implements lukehagar.plexapi.plexapi.util this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetTransientTokenResponse withObject(GetTransientTokenResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetTransientTokenResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class GetTransientTokenResponse implements lukehagar.plexapi.plexapi.util return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class GetTransientTokenResponse implements lukehagar.plexapi.plexapi.util return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class GetTransientTokenResponse implements lukehagar.plexapi.plexapi.util return Utils.toString(GetTransientTokenResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class GetTransientTokenResponse implements lukehagar.plexapi.plexapi.util private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class GetTransientTokenResponse implements lukehagar.plexapi.plexapi.util this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(GetTransientTokenResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public GetTransientTokenResponse build() { return new GetTransientTokenResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusMediaContainer.java index 79400095..44794bcd 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetUpdateStatusMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -43,6 +44,7 @@ public class GetUpdateStatusMediaContainer { @JsonProperty("Release") private Optional> release; + @JsonCreator public GetUpdateStatusMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("canInstall") Optional canInstall, @@ -63,29 +65,45 @@ public class GetUpdateStatusMediaContainer { this.status = status; this.release = release; } - - public Optional size() { - return size; + + public GetUpdateStatusMediaContainer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional canInstall() { - return canInstall; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional checkedAt() { - return checkedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional canInstall() { + return (Optional) canInstall; } - public Optional downloadURL() { - return downloadURL; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional checkedAt() { + return (Optional) checkedAt; } - public Optional status() { - return status; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional downloadURL() { + return (Optional) downloadURL; } - public Optional> release() { - return release; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> release() { + return (Optional>) release; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusResponse.java index 8823a90e..7de16623 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -35,34 +36,35 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. /** * The Server Updates */ - private Optional twoHundredApplicationJsonObject; - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional fourHundredAndOneApplicationJsonObject; + private Optional object; + @JsonCreator public GetUpdateStatusResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional twoHundredApplicationJsonObject, - Optional fourHundredAndOneApplicationJsonObject) { + Optional object) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); + Utils.checkNotNull(object, "object"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + 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; } @@ -70,6 +72,7 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -77,6 +80,7 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -84,15 +88,10 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. /** * The Server Updates */ - public Optional twoHundredApplicationJsonObject() { - return twoHundredApplicationJsonObject; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional fourHundredAndOneApplicationJsonObject() { - return fourHundredAndOneApplicationJsonObject; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { @@ -129,36 +128,18 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. /** * The Server Updates */ - public GetUpdateStatusResponse withTwoHundredApplicationJsonObject(GetUpdateStatusResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public GetUpdateStatusResponse withObject(GetUpdateStatusResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Server Updates */ - public GetUpdateStatusResponse withTwoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetUpdateStatusResponse withFourHundredAndOneApplicationJsonObject(GetUpdateStatusUpdaterResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public GetUpdateStatusResponse withFourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public GetUpdateStatusResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -175,8 +156,7 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.twoHundredApplicationJsonObject, other.twoHundredApplicationJsonObject) && - java.util.Objects.deepEquals(this.fourHundredAndOneApplicationJsonObject, other.fourHundredAndOneApplicationJsonObject); + java.util.Objects.deepEquals(this.object, other.object); } @Override @@ -185,8 +165,7 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } @Override @@ -195,8 +174,7 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "twoHundredApplicationJsonObject", twoHundredApplicationJsonObject, - "fourHundredAndOneApplicationJsonObject", fourHundredAndOneApplicationJsonObject); + "object", object); } public final static class Builder { @@ -207,9 +185,7 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. private HttpResponse rawResponse; - private Optional twoHundredApplicationJsonObject = Optional.empty(); - - private Optional fourHundredAndOneApplicationJsonObject = Optional.empty(); + private Optional object = Optional.empty(); private Builder() { // force use of static builder() method @@ -245,36 +221,18 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. /** * The Server Updates */ - public Builder twoHundredApplicationJsonObject(GetUpdateStatusResponseBody twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = Optional.ofNullable(twoHundredApplicationJsonObject); + public Builder object(GetUpdateStatusResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); return this; } /** * The Server Updates */ - public Builder twoHundredApplicationJsonObject(Optional twoHundredApplicationJsonObject) { - Utils.checkNotNull(twoHundredApplicationJsonObject, "twoHundredApplicationJsonObject"); - this.twoHundredApplicationJsonObject = twoHundredApplicationJsonObject; - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(GetUpdateStatusUpdaterResponseBody fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = Optional.ofNullable(fourHundredAndOneApplicationJsonObject); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder fourHundredAndOneApplicationJsonObject(Optional fourHundredAndOneApplicationJsonObject) { - Utils.checkNotNull(fourHundredAndOneApplicationJsonObject, "fourHundredAndOneApplicationJsonObject"); - this.fourHundredAndOneApplicationJsonObject = fourHundredAndOneApplicationJsonObject; + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; return this; } @@ -283,8 +241,7 @@ public class GetUpdateStatusResponse implements lukehagar.plexapi.plexapi.utils. contentType, statusCode, rawResponse, - twoHundredApplicationJsonObject, - fourHundredAndOneApplicationJsonObject); + object); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusResponseBody.java index 96c168dc..19a72c2a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * GetUpdateStatusResponseBody - The Server Updates */ @@ -26,14 +27,21 @@ public class GetUpdateStatusResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public GetUpdateStatusResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public GetUpdateStatusResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusUpdaterResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusUpdaterResponseBody.java deleted file mode 100644 index 391ba3a8..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetUpdateStatusUpdaterResponseBody.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.models.operations; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.type.TypeReference; -import java.io.InputStream; -import java.lang.Deprecated; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Optional; -import lukehagar.plexapi.plexapi.utils.Utils; - -/** - * GetUpdateStatusUpdaterResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - -public class GetUpdateStatusUpdaterResponseBody { - - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("errors") - private Optional> errors; - - public GetUpdateStatusUpdaterResponseBody( - @JsonProperty("errors") Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - } - - public Optional> errors() { - return errors; - } - - public final static Builder builder() { - return new Builder(); - } - - public GetUpdateStatusUpdaterResponseBody withErrors(java.util.List errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = Optional.ofNullable(errors); - return this; - } - - public GetUpdateStatusUpdaterResponseBody withErrors(Optional> errors) { - Utils.checkNotNull(errors, "errors"); - this.errors = errors; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetUpdateStatusUpdaterResponseBody other = (GetUpdateStatusUpdaterResponseBody) o; - return - java.util.Objects.deepEquals(this.errors, other.errors); - } - - @Override - public int hashCode() { - return java.util.Objects.hash( - errors); - } - - @Override - public String toString() { - return Utils.toString(GetUpdateStatusUpdaterResponseBody.class, - "errors", errors); - } - - public final static class Builder { - - private Optional> errors = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - public Builder errors(java.util.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; - } - - public GetUpdateStatusUpdaterResponseBody build() { - return new GetUpdateStatusUpdaterResponseBody( - errors); - } - } -} - diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistRequest.java new file mode 100644 index 00000000..38a3a661 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistRequest.java @@ -0,0 +1,642 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetWatchlistRequest { + + /** + * Filter + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=filter") + private PathParamFilter filter; + + /** + * In the format "field:dir". Available fields are "watchlistedAt" (Added At), + * "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). + * "dir" can be "asc" or "desc" + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=sort") + private Optional sort; + + /** + * The type of library to filter. Can be "movie" or "show", or all if not present. + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=libtype") + private Optional libtype; + + /** + * 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. + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=maxresults") + private Optional maxresults; + + /** + * include collections in the results + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeCollections") + private Optional includeCollections; + + /** + * include external media in the results + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeExternalMedia") + private Optional includeExternalMedia; + + /** + * User Token + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token") + private String xPlexToken; + + /** + * 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. + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Container-Start") + private Optional xPlexContainerStart; + + /** + * 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. + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Container-Size") + private Optional xPlexContainerSize; + + @JsonCreator + public GetWatchlistRequest( + PathParamFilter filter, + Optional sort, + Optional libtype, + Optional maxresults, + Optional includeCollections, + Optional includeExternalMedia, + String xPlexToken, + Optional xPlexContainerStart, + Optional xPlexContainerSize) { + Utils.checkNotNull(filter, "filter"); + Utils.checkNotNull(sort, "sort"); + Utils.checkNotNull(libtype, "libtype"); + Utils.checkNotNull(maxresults, "maxresults"); + Utils.checkNotNull(includeCollections, "includeCollections"); + Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); + Utils.checkNotNull(xPlexToken, "xPlexToken"); + Utils.checkNotNull(xPlexContainerStart, "xPlexContainerStart"); + Utils.checkNotNull(xPlexContainerSize, "xPlexContainerSize"); + this.filter = filter; + this.sort = sort; + this.libtype = libtype; + this.maxresults = maxresults; + this.includeCollections = includeCollections; + this.includeExternalMedia = includeExternalMedia; + this.xPlexToken = xPlexToken; + this.xPlexContainerStart = xPlexContainerStart; + this.xPlexContainerSize = xPlexContainerSize; + } + + public GetWatchlistRequest( + PathParamFilter filter, + String xPlexToken) { + this(filter, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), xPlexToken, Optional.empty(), Optional.empty()); + } + + /** + * Filter + */ + @JsonIgnore + public PathParamFilter filter() { + return filter; + } + + /** + * In the format "field:dir". Available fields are "watchlistedAt" (Added At), + * "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). + * "dir" can be "asc" or "desc" + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sort() { + return (Optional) sort; + } + + /** + * The type of library to filter. Can be "movie" or "show", or all if not present. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional libtype() { + return (Optional) libtype; + } + + /** + * 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. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional maxresults() { + return (Optional) maxresults; + } + + /** + * include collections in the results + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional includeCollections() { + return (Optional) includeCollections; + } + + /** + * include external media in the results + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional includeExternalMedia() { + return (Optional) includeExternalMedia; + } + + /** + * User Token + */ + @JsonIgnore + public String xPlexToken() { + return xPlexToken; + } + + /** + * 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. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional xPlexContainerStart() { + return (Optional) xPlexContainerStart; + } + + /** + * 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. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional xPlexContainerSize() { + return (Optional) xPlexContainerSize; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Filter + */ + public GetWatchlistRequest withFilter(PathParamFilter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + /** + * In the format "field:dir". Available fields are "watchlistedAt" (Added At), + * "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). + * "dir" can be "asc" or "desc" + * + */ + public GetWatchlistRequest withSort(String sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = Optional.ofNullable(sort); + return this; + } + + /** + * In the format "field:dir". Available fields are "watchlistedAt" (Added At), + * "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). + * "dir" can be "asc" or "desc" + * + */ + public GetWatchlistRequest withSort(Optional sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = sort; + return this; + } + + /** + * The type of library to filter. Can be "movie" or "show", or all if not present. + * + */ + public GetWatchlistRequest withLibtype(Libtype libtype) { + Utils.checkNotNull(libtype, "libtype"); + this.libtype = Optional.ofNullable(libtype); + return this; + } + + /** + * The type of library to filter. Can be "movie" or "show", or all if not present. + * + */ + public GetWatchlistRequest withLibtype(Optional libtype) { + Utils.checkNotNull(libtype, "libtype"); + this.libtype = libtype; + 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. + * + */ + public GetWatchlistRequest withMaxresults(int maxresults) { + Utils.checkNotNull(maxresults, "maxresults"); + this.maxresults = Optional.ofNullable(maxresults); + 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. + * + */ + public GetWatchlistRequest withMaxresults(Optional maxresults) { + Utils.checkNotNull(maxresults, "maxresults"); + this.maxresults = maxresults; + return this; + } + + /** + * include collections in the results + * + */ + public GetWatchlistRequest withIncludeCollections(IncludeCollections includeCollections) { + Utils.checkNotNull(includeCollections, "includeCollections"); + this.includeCollections = Optional.ofNullable(includeCollections); + return this; + } + + /** + * include collections in the results + * + */ + public GetWatchlistRequest withIncludeCollections(Optional includeCollections) { + Utils.checkNotNull(includeCollections, "includeCollections"); + this.includeCollections = includeCollections; + return this; + } + + /** + * include external media in the results + * + */ + public GetWatchlistRequest withIncludeExternalMedia(IncludeExternalMedia includeExternalMedia) { + Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); + this.includeExternalMedia = Optional.ofNullable(includeExternalMedia); + return this; + } + + /** + * include external media in the results + * + */ + public GetWatchlistRequest withIncludeExternalMedia(Optional includeExternalMedia) { + Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); + this.includeExternalMedia = includeExternalMedia; + return this; + } + + /** + * User Token + */ + public GetWatchlistRequest withXPlexToken(String xPlexToken) { + Utils.checkNotNull(xPlexToken, "xPlexToken"); + this.xPlexToken = xPlexToken; + 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. + * + */ + public GetWatchlistRequest withXPlexContainerStart(int xPlexContainerStart) { + Utils.checkNotNull(xPlexContainerStart, "xPlexContainerStart"); + this.xPlexContainerStart = Optional.ofNullable(xPlexContainerStart); + 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. + * + */ + public GetWatchlistRequest withXPlexContainerStart(Optional xPlexContainerStart) { + Utils.checkNotNull(xPlexContainerStart, "xPlexContainerStart"); + this.xPlexContainerStart = xPlexContainerStart; + 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. + * + */ + public GetWatchlistRequest withXPlexContainerSize(int xPlexContainerSize) { + Utils.checkNotNull(xPlexContainerSize, "xPlexContainerSize"); + this.xPlexContainerSize = Optional.ofNullable(xPlexContainerSize); + 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. + * + */ + public GetWatchlistRequest withXPlexContainerSize(Optional xPlexContainerSize) { + Utils.checkNotNull(xPlexContainerSize, "xPlexContainerSize"); + this.xPlexContainerSize = xPlexContainerSize; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWatchlistRequest other = (GetWatchlistRequest) o; + return + java.util.Objects.deepEquals(this.filter, other.filter) && + java.util.Objects.deepEquals(this.sort, other.sort) && + java.util.Objects.deepEquals(this.libtype, other.libtype) && + java.util.Objects.deepEquals(this.maxresults, other.maxresults) && + java.util.Objects.deepEquals(this.includeCollections, other.includeCollections) && + java.util.Objects.deepEquals(this.includeExternalMedia, other.includeExternalMedia) && + java.util.Objects.deepEquals(this.xPlexToken, other.xPlexToken) && + java.util.Objects.deepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && + java.util.Objects.deepEquals(this.xPlexContainerSize, other.xPlexContainerSize); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + filter, + sort, + libtype, + maxresults, + includeCollections, + includeExternalMedia, + xPlexToken, + xPlexContainerStart, + xPlexContainerSize); + } + + @Override + public String toString() { + return Utils.toString(GetWatchlistRequest.class, + "filter", filter, + "sort", sort, + "libtype", libtype, + "maxresults", maxresults, + "includeCollections", includeCollections, + "includeExternalMedia", includeExternalMedia, + "xPlexToken", xPlexToken, + "xPlexContainerStart", xPlexContainerStart, + "xPlexContainerSize", xPlexContainerSize); + } + + public final static class Builder { + + private PathParamFilter 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 String xPlexToken; + + private Optional xPlexContainerStart = Optional.empty(); + + private Optional xPlexContainerSize = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Filter + */ + public Builder filter(PathParamFilter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + /** + * In the format "field:dir". Available fields are "watchlistedAt" (Added At), + * "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). + * "dir" can be "asc" or "desc" + * + */ + public Builder sort(String sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = Optional.ofNullable(sort); + return this; + } + + /** + * In the format "field:dir". Available fields are "watchlistedAt" (Added At), + * "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). + * "dir" can be "asc" or "desc" + * + */ + public Builder sort(Optional sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = sort; + return this; + } + + /** + * The type of library to filter. Can be "movie" or "show", or all if not present. + * + */ + public Builder libtype(Libtype libtype) { + Utils.checkNotNull(libtype, "libtype"); + this.libtype = Optional.ofNullable(libtype); + return this; + } + + /** + * The type of library to filter. Can be "movie" or "show", or all if not present. + * + */ + public Builder libtype(Optional libtype) { + Utils.checkNotNull(libtype, "libtype"); + this.libtype = libtype; + 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. + * + */ + public Builder maxresults(int maxresults) { + Utils.checkNotNull(maxresults, "maxresults"); + this.maxresults = Optional.ofNullable(maxresults); + 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. + * + */ + public Builder maxresults(Optional maxresults) { + Utils.checkNotNull(maxresults, "maxresults"); + this.maxresults = maxresults; + return this; + } + + /** + * include collections in the results + * + */ + public Builder includeCollections(IncludeCollections includeCollections) { + Utils.checkNotNull(includeCollections, "includeCollections"); + this.includeCollections = Optional.ofNullable(includeCollections); + return this; + } + + /** + * include collections in the results + * + */ + public Builder includeCollections(Optional includeCollections) { + Utils.checkNotNull(includeCollections, "includeCollections"); + this.includeCollections = includeCollections; + return this; + } + + /** + * include external media in the results + * + */ + public Builder includeExternalMedia(IncludeExternalMedia includeExternalMedia) { + Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); + this.includeExternalMedia = Optional.ofNullable(includeExternalMedia); + return this; + } + + /** + * include external media in the results + * + */ + public Builder includeExternalMedia(Optional includeExternalMedia) { + Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); + this.includeExternalMedia = includeExternalMedia; + return this; + } + + /** + * User Token + */ + public Builder xPlexToken(String xPlexToken) { + Utils.checkNotNull(xPlexToken, "xPlexToken"); + this.xPlexToken = xPlexToken; + 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. + * + */ + public Builder xPlexContainerStart(int xPlexContainerStart) { + Utils.checkNotNull(xPlexContainerStart, "xPlexContainerStart"); + this.xPlexContainerStart = Optional.ofNullable(xPlexContainerStart); + 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. + * + */ + public Builder xPlexContainerStart(Optional xPlexContainerStart) { + Utils.checkNotNull(xPlexContainerStart, "xPlexContainerStart"); + this.xPlexContainerStart = xPlexContainerStart; + 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. + * + */ + public Builder xPlexContainerSize(int xPlexContainerSize) { + Utils.checkNotNull(xPlexContainerSize, "xPlexContainerSize"); + this.xPlexContainerSize = Optional.ofNullable(xPlexContainerSize); + 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. + * + */ + public Builder xPlexContainerSize(Optional xPlexContainerSize) { + Utils.checkNotNull(xPlexContainerSize, "xPlexContainerSize"); + this.xPlexContainerSize = xPlexContainerSize; + return this; + } + + public GetWatchlistRequest build() { + return new GetWatchlistRequest( + filter, + sort, + libtype, + maxresults, + includeCollections, + includeExternalMedia, + xPlexToken, + xPlexContainerStart, + xPlexContainerSize); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistRequestBuilder.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistRequestBuilder.java new file mode 100644 index 00000000..415bc889 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import lukehagar.plexapi.plexapi.models.errors.SDKError; +import lukehagar.plexapi.plexapi.utils.LazySingletonValue; +import lukehagar.plexapi.plexapi.utils.Utils; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetWatchlistRequestBuilder { + + private GetWatchlistRequest request; + private java.util.Optional serverURL = Optional.empty(); + private final SDKMethodInterfaces.MethodCallGetWatchlist sdk; + + public GetWatchlistRequestBuilder(SDKMethodInterfaces.MethodCallGetWatchlist sdk) { + this.sdk = sdk; + } + + 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(java.util.Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + public GetWatchlistResponse call() throws Exception { + + return sdk.getWatchlist( + request, + serverURL); + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistResponse.java new file mode 100644 index 00000000..4bf18090 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +public class GetWatchlistResponse implements lukehagar.plexapi.plexapi.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * 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 final 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 + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetWatchlistResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * 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/lukehagar/plexapi/plexapi/models/operations/GetWatchlistResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistResponseBody.java new file mode 100644 index 00000000..1e2eacdc --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/GetWatchlistResponseBody.java @@ -0,0 +1,372 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; +/** + * GetWatchlistResponseBody - Watchlist Data + */ + +public class GetWatchlistResponseBody { + + @JsonInclude(Include.NON_ABSENT) + @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; + + @JsonCreator + public GetWatchlistResponseBody( + @JsonProperty("librarySectionID") Optional librarySectionID, + @JsonProperty("librarySectionTitle") Optional librarySectionTitle, + @JsonProperty("offset") Optional offset, + @JsonProperty("totalSize") Optional totalSize, + @JsonProperty("identifier") Optional identifier, + @JsonProperty("size") Optional size, + @JsonProperty("Metadata") Optional> metadata) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + Utils.checkNotNull(offset, "offset"); + Utils.checkNotNull(totalSize, "totalSize"); + Utils.checkNotNull(identifier, "identifier"); + Utils.checkNotNull(size, "size"); + Utils.checkNotNull(metadata, "metadata"); + this.librarySectionID = librarySectionID; + this.librarySectionTitle = librarySectionTitle; + this.offset = offset; + this.totalSize = totalSize; + this.identifier = identifier; + this.size = size; + this.metadata = metadata; + } + + public GetWatchlistResponseBody() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionID() { + return (Optional) librarySectionID; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional librarySectionTitle() { + return (Optional) librarySectionTitle; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional totalSize() { + return (Optional) totalSize; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetWatchlistResponseBody withLibrarySectionID(String librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = Optional.ofNullable(librarySectionID); + return this; + } + + public GetWatchlistResponseBody withLibrarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + public GetWatchlistResponseBody withLibrarySectionTitle(String librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); + return this; + } + + public GetWatchlistResponseBody withLibrarySectionTitle(Optional librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = librarySectionTitle; + return this; + } + + public GetWatchlistResponseBody withOffset(int offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + public GetWatchlistResponseBody withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public GetWatchlistResponseBody withTotalSize(int totalSize) { + Utils.checkNotNull(totalSize, "totalSize"); + this.totalSize = Optional.ofNullable(totalSize); + return this; + } + + public GetWatchlistResponseBody withTotalSize(Optional totalSize) { + Utils.checkNotNull(totalSize, "totalSize"); + this.totalSize = totalSize; + return this; + } + + public GetWatchlistResponseBody withIdentifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = Optional.ofNullable(identifier); + return this; + } + + public GetWatchlistResponseBody withIdentifier(Optional identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + public GetWatchlistResponseBody withSize(int size) { + Utils.checkNotNull(size, "size"); + this.size = Optional.ofNullable(size); + return this; + } + + public GetWatchlistResponseBody withSize(Optional size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + public GetWatchlistResponseBody withMetadata(java.util.List metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWatchlistResponseBody other = (GetWatchlistResponseBody) o; + return + java.util.Objects.deepEquals(this.librarySectionID, other.librarySectionID) && + java.util.Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && + java.util.Objects.deepEquals(this.offset, other.offset) && + java.util.Objects.deepEquals(this.totalSize, other.totalSize) && + java.util.Objects.deepEquals(this.identifier, other.identifier) && + java.util.Objects.deepEquals(this.size, other.size) && + java.util.Objects.deepEquals(this.metadata, other.metadata); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + librarySectionID, + librarySectionTitle, + offset, + totalSize, + identifier, + size, + metadata); + } + + @Override + public String toString() { + return Utils.toString(GetWatchlistResponseBody.class, + "librarySectionID", librarySectionID, + "librarySectionTitle", librarySectionTitle, + "offset", offset, + "totalSize", totalSize, + "identifier", identifier, + "size", size, + "metadata", metadata); + } + + 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); + return this; + } + + public Builder librarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + public Builder librarySectionTitle(String librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); + return this; + } + + public Builder librarySectionTitle(Optional librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = librarySectionTitle; + return this; + } + + public Builder offset(int offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public Builder totalSize(int totalSize) { + Utils.checkNotNull(totalSize, "totalSize"); + this.totalSize = Optional.ofNullable(totalSize); + return this; + } + + public Builder totalSize(Optional totalSize) { + Utils.checkNotNull(totalSize, "totalSize"); + this.totalSize = totalSize; + return this; + } + + public Builder identifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = Optional.ofNullable(identifier); + return this; + } + + public Builder identifier(Optional identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + public Builder size(int size) { + Utils.checkNotNull(size, "size"); + this.size = Optional.ofNullable(size); + return this; + } + + public Builder size(Optional size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + public Builder metadata(java.util.List metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public GetWatchlistResponseBody build() { + return new GetWatchlistResponseBody( + librarySectionID, + librarySectionTitle, + offset, + totalSize, + identifier, + size, + metadata); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Guids.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Guids.java index 663269c7..cd18d0fb 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Guids.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Guids.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Guids { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonCreator public Guids( @JsonProperty("id") Optional id) { Utils.checkNotNull(id, "id"); this.id = id; } + + public Guids() { + this(Optional.empty()); + } - public Optional id() { - return id; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Hub.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Hub.java index e7e4ad42..4ae7a25a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Hub.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Hub.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Hub { @JsonInclude(Include.NON_ABSENT) @@ -63,6 +64,7 @@ public class Hub { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public Hub( @JsonProperty("hubKey") Optional hubKey, @JsonProperty("key") Optional key, @@ -98,49 +100,75 @@ public class Hub { this.promoted = promoted; this.metadata = metadata; } - - public Optional hubKey() { - return hubKey; + + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hubKey() { + return (Optional) hubKey; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional hubIdentifier() { - return hubIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional context() { - return context; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hubIdentifier() { + return (Optional) hubIdentifier; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional context() { + return (Optional) context; } - public Optional more() { - return more; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional style() { - return style; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional more() { + return (Optional) more; } - public Optional promoted() { - return promoted; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional style() { + return (Optional) style; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional promoted() { + return (Optional) promoted; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Image.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Image.java new file mode 100644 index 00000000..d5423001 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Image.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public Image( + @JsonProperty("alt") Optional alt, + @JsonProperty("type") Optional type, + @JsonProperty("url") Optional url) { + Utils.checkNotNull(alt, "alt"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(url, "url"); + this.alt = alt; + this.type = type; + this.url = url; + } + + public Image() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional alt() { + return (Optional) alt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional url() { + return (Optional) url; + } + + public final static Builder builder() { + return new Builder(); + } + + public Image withAlt(String alt) { + Utils.checkNotNull(alt, "alt"); + this.alt = Optional.ofNullable(alt); + return this; + } + + public Image withAlt(Optional alt) { + Utils.checkNotNull(alt, "alt"); + this.alt = alt; + return this; + } + + public Image withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + public Image withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Image withUrl(String url) { + Utils.checkNotNull(url, "url"); + this.url = Optional.ofNullable(url); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Image other = (Image) o; + return + java.util.Objects.deepEquals(this.alt, other.alt) && + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.url, other.url); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + alt, + type, + url); + } + + @Override + public String toString() { + return Utils.toString(Image.class, + "alt", alt, + "type", type, + "url", url); + } + + 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); + return this; + } + + public Builder alt(Optional alt) { + Utils.checkNotNull(alt, "alt"); + this.alt = alt; + return this; + } + + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = Optional.ofNullable(url); + return this; + } + + public Builder url(Optional url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + public Image build() { + return new Image( + alt, + type, + url); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeCollections.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeCollections.java new file mode 100644 index 00000000..f8daf2a4 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeCollections.java @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * IncludeCollections - include collections in the results + * + */ +public enum IncludeCollections { + ONE(1L), + ZERO(0L); + + @JsonValue + private final long value; + + private IncludeCollections(long value) { + this.value = value; + } + + public long value() { + return value; + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeDetails.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeDetails.java index 5e2fe550..79a6995f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeDetails.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeDetails.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeExternalMedia.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeExternalMedia.java new file mode 100644 index 00000000..9fb97ffc --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/IncludeExternalMedia.java @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * IncludeExternalMedia - include external media in the results + * + */ +public enum IncludeExternalMedia { + ONE(1L), + ZERO(0L); + + @JsonValue + private final long value; + + private IncludeExternalMedia(long value) { + this.value = value; + } + + public long value() { + return value; + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Level.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Level.java index d800ef43..c41ab86f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Level.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Level.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LibrarySectionID.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/LibrarySectionID.java new file mode 100644 index 00000000..014effc6 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/LibrarySectionID.java @@ -0,0 +1,100 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import lukehagar.plexapi.plexapi.utils.Utils; + +import java.time.OffsetDateTime; +import java.time.LocalDate; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import lukehagar.plexapi.plexapi.utils.TypedObject; +import lukehagar.plexapi.plexapi.utils.Utils.JsonShape; + + +@JsonDeserialize(using = LibrarySectionID._Deserializer.class) +public class LibrarySectionID { + + @com.fasterxml.jackson.annotation.JsonValue + private TypedObject value; + + private LibrarySectionID(TypedObject value) { + this.value = value; + } + + public static LibrarySectionID of(long value) { + Utils.checkNotNull(value, "value"); + return new LibrarySectionID(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + public static LibrarySectionID of(String value) { + Utils.checkNotNull(value, "value"); + return new LibrarySectionID(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code long}
  • + *
  • {@code String}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibrarySectionID other = (LibrarySectionID) o; + return java.util.Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends lukehagar.plexapi.plexapi.utils.OneOfDeserializer { + + public _Deserializer() { + super(LibrarySectionID.class, + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT), + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(LibrarySectionID.class, + "value", value); + } + +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Libtype.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Libtype.java new file mode 100644 index 00000000..4dae2edc --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Libtype.java @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * Libtype - The type of library to filter. Can be "movie" or "show", or all if not present. + * + */ +public enum Libtype { + MOVIE("movie"), + SHOW("show"); + + @JsonValue + private final String value; + + private Libtype(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Location.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Location.java index 36823c45..58898c15 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Location.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Location.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Location { @JsonInclude(Include.NON_ABSENT) @@ -45,7 +46,7 @@ public class Location { @JsonInclude(Include.NON_ABSENT) @JsonProperty("postal_code") - private Optional postalCode; + private Optional postalCode; @JsonInclude(Include.NON_ABSENT) @JsonProperty("in_privacy_restricted_country") @@ -59,6 +60,7 @@ public class Location { @JsonProperty("coordinates") private Optional coordinates; + @JsonCreator public Location( @JsonProperty("code") Optional code, @JsonProperty("european_union_member") Optional europeanUnionMember, @@ -66,7 +68,7 @@ public class Location { @JsonProperty("country") Optional country, @JsonProperty("city") Optional city, @JsonProperty("time_zone") Optional timeZone, - @JsonProperty("postal_code") Optional postalCode, + @JsonProperty("postal_code") Optional postalCode, @JsonProperty("in_privacy_restricted_country") Optional inPrivacyRestrictedCountry, @JsonProperty("subdivisions") Optional subdivisions, @JsonProperty("coordinates") Optional coordinates) { @@ -91,45 +93,69 @@ public class Location { this.subdivisions = subdivisions; this.coordinates = coordinates; } - - public Optional code() { - return code; + + public Location() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional europeanUnionMember() { - return europeanUnionMember; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional code() { + return (Optional) code; } - public Optional continentCode() { - return continentCode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional europeanUnionMember() { + return (Optional) europeanUnionMember; } - public Optional country() { - return country; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional continentCode() { + return (Optional) continentCode; } - public Optional city() { - return city; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional country() { + return (Optional) country; } - public Optional timeZone() { - return timeZone; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional city() { + return (Optional) city; } - public Optional postalCode() { - return postalCode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional timeZone() { + return (Optional) timeZone; } - public Optional inPrivacyRestrictedCountry() { - return inPrivacyRestrictedCountry; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional postalCode() { + return (Optional) postalCode; } - public Optional subdivisions() { - return subdivisions; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional inPrivacyRestrictedCountry() { + return (Optional) inPrivacyRestrictedCountry; } - public Optional coordinates() { - return coordinates; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subdivisions() { + return (Optional) subdivisions; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional coordinates() { + return (Optional) coordinates; } public final static Builder builder() { @@ -208,13 +234,13 @@ public class Location { return this; } - public Location withPostalCode(double postalCode) { + public Location withPostalCode(String postalCode) { Utils.checkNotNull(postalCode, "postalCode"); this.postalCode = Optional.ofNullable(postalCode); return this; } - public Location withPostalCode(Optional postalCode) { + public Location withPostalCode(Optional postalCode) { Utils.checkNotNull(postalCode, "postalCode"); this.postalCode = postalCode; return this; @@ -322,7 +348,7 @@ public class Location { private Optional timeZone = Optional.empty(); - private Optional postalCode = Optional.empty(); + private Optional postalCode = Optional.empty(); private Optional inPrivacyRestrictedCountry = Optional.empty(); @@ -406,13 +432,13 @@ public class Location { return this; } - public Builder postalCode(double postalCode) { + public Builder postalCode(String postalCode) { Utils.checkNotNull(postalCode, "postalCode"); this.postalCode = Optional.ofNullable(postalCode); return this; } - public Builder postalCode(Optional postalCode) { + public Builder postalCode(Optional postalCode) { Utils.checkNotNull(postalCode, "postalCode"); this.postalCode = postalCode; return this; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineRequest.java index 194e3490..91181265 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class LogLineRequest { /** @@ -40,6 +41,7 @@ public class LogLineRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=source") private String source; + @JsonCreator public LogLineRequest( Level level, String message, @@ -61,6 +63,7 @@ public class LogLineRequest { * 4: Verbose * */ + @JsonIgnore public Level level() { return level; } @@ -68,6 +71,7 @@ public class LogLineRequest { /** * The text of the message to write to the log. */ + @JsonIgnore public String message() { return message; } @@ -75,6 +79,7 @@ public class LogLineRequest { /** * a string indicating the source of the message. */ + @JsonIgnore public String source() { return source; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineResponse.java index e586823b..8bd6e905 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogLineResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class LogLineResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class LogLineResponse implements lukehagar.plexapi.plexapi.utils.Response */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public LogLineResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class LogLineResponse implements lukehagar.plexapi.plexapi.utils.Response /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class LogLineResponse implements lukehagar.plexapi.plexapi.utils.Response /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class LogLineResponse implements lukehagar.plexapi.plexapi.utils.Response this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public LogLineResponse withObject(LogLineResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public LogLineResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class LogLineResponse implements lukehagar.plexapi.plexapi.utils.Response return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class LogLineResponse implements lukehagar.plexapi.plexapi.utils.Response return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class LogLineResponse implements lukehagar.plexapi.plexapi.utils.Response return Utils.toString(LogLineResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class LogLineResponse implements lukehagar.plexapi.plexapi.utils.Response private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class LogLineResponse implements lukehagar.plexapi.plexapi.utils.Response this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(LogLineResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public LogLineResponse build() { return new LogLineResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineResponse.java index 414d14cc..20e1f4a4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/LogMultiLineResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class LogMultiLineResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class LogMultiLineResponse implements lukehagar.plexapi.plexapi.utils.Res */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public LogMultiLineResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class LogMultiLineResponse implements lukehagar.plexapi.plexapi.utils.Res /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class LogMultiLineResponse implements lukehagar.plexapi.plexapi.utils.Res /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class LogMultiLineResponse implements lukehagar.plexapi.plexapi.utils.Res this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public LogMultiLineResponse withObject(LogMultiLineResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public LogMultiLineResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class LogMultiLineResponse implements lukehagar.plexapi.plexapi.utils.Res return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class LogMultiLineResponse implements lukehagar.plexapi.plexapi.utils.Res return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class LogMultiLineResponse implements lukehagar.plexapi.plexapi.utils.Res return Utils.toString(LogMultiLineResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class LogMultiLineResponse implements lukehagar.plexapi.plexapi.utils.Res private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class LogMultiLineResponse implements lukehagar.plexapi.plexapi.utils.Res this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(LogMultiLineResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public LogMultiLineResponse build() { return new LogMultiLineResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedRequest.java index e476c765..bf067da8 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class MarkPlayedRequest { /** @@ -22,6 +23,7 @@ public class MarkPlayedRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=key") private double key; + @JsonCreator public MarkPlayedRequest( double key) { Utils.checkNotNull(key, "key"); @@ -31,6 +33,7 @@ public class MarkPlayedRequest { /** * The media key to mark as played */ + @JsonIgnore public double key() { return key; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedResponse.java index 7e1fb4a4..ad8963b0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkPlayedResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class MarkPlayedResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class MarkPlayedResponse implements lukehagar.plexapi.plexapi.utils.Respo */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public MarkPlayedResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class MarkPlayedResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class MarkPlayedResponse implements lukehagar.plexapi.plexapi.utils.Respo /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class MarkPlayedResponse implements lukehagar.plexapi.plexapi.utils.Respo this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public MarkPlayedResponse withObject(MarkPlayedResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public MarkPlayedResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class MarkPlayedResponse implements lukehagar.plexapi.plexapi.utils.Respo return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class MarkPlayedResponse implements lukehagar.plexapi.plexapi.utils.Respo return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class MarkPlayedResponse implements lukehagar.plexapi.plexapi.utils.Respo return Utils.toString(MarkPlayedResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class MarkPlayedResponse implements lukehagar.plexapi.plexapi.utils.Respo private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class MarkPlayedResponse implements lukehagar.plexapi.plexapi.utils.Respo this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(MarkPlayedResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public MarkPlayedResponse build() { return new MarkPlayedResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedRequest.java index 48e4ea39..d8afa1ea 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class MarkUnplayedRequest { /** @@ -22,6 +23,7 @@ public class MarkUnplayedRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=key") private double key; + @JsonCreator public MarkUnplayedRequest( double key) { Utils.checkNotNull(key, "key"); @@ -31,6 +33,7 @@ public class MarkUnplayedRequest { /** * The media key to mark as Unplayed */ + @JsonIgnore public double key() { return key; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedResponse.java index fa165772..0ebba90e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MarkUnplayedResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class MarkUnplayedResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class MarkUnplayedResponse implements lukehagar.plexapi.plexapi.utils.Res */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public MarkUnplayedResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class MarkUnplayedResponse implements lukehagar.plexapi.plexapi.utils.Res /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class MarkUnplayedResponse implements lukehagar.plexapi.plexapi.utils.Res /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class MarkUnplayedResponse implements lukehagar.plexapi.plexapi.utils.Res this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public MarkUnplayedResponse withObject(MarkUnplayedResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public MarkUnplayedResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class MarkUnplayedResponse implements lukehagar.plexapi.plexapi.utils.Res return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class MarkUnplayedResponse implements lukehagar.plexapi.plexapi.utils.Res return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class MarkUnplayedResponse implements lukehagar.plexapi.plexapi.utils.Res return Utils.toString(MarkUnplayedResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class MarkUnplayedResponse implements lukehagar.plexapi.plexapi.utils.Res private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class MarkUnplayedResponse implements lukehagar.plexapi.plexapi.utils.Res this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(MarkUnplayedResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public MarkUnplayedResponse build() { return new MarkUnplayedResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Media.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Media.java index 1ff90b71..8a68ca98 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Media.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Media.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Media { @JsonInclude(Include.NON_ABSENT) @@ -83,6 +84,7 @@ public class Media { @JsonProperty("Part") private Optional> part; + @JsonCreator public Media( @JsonProperty("id") Optional id, @JsonProperty("duration") Optional duration, @@ -133,69 +135,105 @@ public class Media { this.videoProfile = videoProfile; this.part = part; } - - public Optional id() { - return id; + + public Media() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional width() { - return width; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional height() { - return height; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional width() { + return (Optional) width; } - public Optional aspectRatio() { - return aspectRatio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional height() { + return (Optional) height; } - public Optional audioChannels() { - return audioChannels; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional aspectRatio() { + return (Optional) aspectRatio; } - public Optional audioCodec() { - return audioCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioChannels() { + return (Optional) audioChannels; } - public Optional videoCodec() { - return videoCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioCodec() { + return (Optional) audioCodec; } - public Optional videoResolution() { - return videoResolution; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoCodec() { + return (Optional) videoCodec; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoResolution() { + return (Optional) videoResolution; } - public Optional videoFrameRate() { - return videoFrameRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional optimizedForStreaming() { - return optimizedForStreaming; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoFrameRate() { + return (Optional) videoFrameRate; } - public Optional has64bitOffsets() { - return has64bitOffsets; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional optimizedForStreaming() { + return (Optional) optimizedForStreaming; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional has64bitOffsets() { + return (Optional) has64bitOffsets; } - public Optional> part() { - return part; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> part() { + return (Optional>) part; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MediaContainer.java index 5262b7b7..e7921668 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class MediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -223,6 +224,7 @@ public class MediaContainer { @JsonProperty("Directory") private Optional> directory; + @JsonCreator public MediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowCameraUpload") Optional allowCameraUpload, @@ -378,209 +380,315 @@ public class MediaContainer { this.voiceSearch = voiceSearch; this.directory = directory; } - - public Optional size() { - return size; + + 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()); } - public Optional allowCameraUpload() { - return allowCameraUpload; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional allowChannelAccess() { - return allowChannelAccess; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowCameraUpload() { + return (Optional) allowCameraUpload; } - public Optional allowMediaDeletion() { - return allowMediaDeletion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowChannelAccess() { + return (Optional) allowChannelAccess; } - public Optional allowSharing() { - return allowSharing; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowMediaDeletion() { + return (Optional) allowMediaDeletion; } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSharing() { + return (Optional) allowSharing; } - public Optional allowTuners() { - return allowTuners; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional backgroundProcessing() { - return backgroundProcessing; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowTuners() { + return (Optional) allowTuners; } - public Optional certificate() { - return certificate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional backgroundProcessing() { + return (Optional) backgroundProcessing; } - public Optional companionProxy() { - return companionProxy; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional certificate() { + return (Optional) certificate; } - public Optional countryCode() { - return countryCode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional companionProxy() { + return (Optional) companionProxy; } - public Optional diagnostics() { - return diagnostics; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional countryCode() { + return (Optional) countryCode; } - public Optional eventStream() { - return eventStream; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional diagnostics() { + return (Optional) diagnostics; } - public Optional friendlyName() { - return friendlyName; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional eventStream() { + return (Optional) eventStream; } - public Optional hubSearch() { - return hubSearch; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional friendlyName() { + return (Optional) friendlyName; } - public Optional itemClusters() { - return itemClusters; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hubSearch() { + return (Optional) hubSearch; } - public Optional livetv() { - return livetv; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional itemClusters() { + return (Optional) itemClusters; } - public Optional machineIdentifier() { - return machineIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional livetv() { + return (Optional) livetv; } - public Optional mediaProviders() { - return mediaProviders; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional machineIdentifier() { + return (Optional) machineIdentifier; } - public Optional multiuser() { - return multiuser; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaProviders() { + return (Optional) mediaProviders; } - public Optional musicAnalysis() { - return musicAnalysis; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional multiuser() { + return (Optional) multiuser; } - public Optional myPlex() { - return myPlex; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional musicAnalysis() { + return (Optional) musicAnalysis; } - public Optional myPlexMappingState() { - return myPlexMappingState; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional myPlex() { + return (Optional) myPlex; } - public Optional myPlexSigninState() { - return myPlexSigninState; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional myPlexMappingState() { + return (Optional) myPlexMappingState; } - public Optional myPlexSubscription() { - return myPlexSubscription; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional myPlexSigninState() { + return (Optional) myPlexSigninState; } - public Optional myPlexUsername() { - return myPlexUsername; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional myPlexSubscription() { + return (Optional) myPlexSubscription; } - public Optional offlineTranscode() { - return offlineTranscode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional myPlexUsername() { + return (Optional) myPlexUsername; } - public Optional ownerFeatures() { - return ownerFeatures; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offlineTranscode() { + return (Optional) offlineTranscode; } - public Optional photoAutoTag() { - return photoAutoTag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ownerFeatures() { + return (Optional) ownerFeatures; } - public Optional platform() { - return platform; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional photoAutoTag() { + return (Optional) photoAutoTag; } - public Optional platformVersion() { - return platformVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platform() { + return (Optional) platform; } - public Optional pluginHost() { - return pluginHost; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platformVersion() { + return (Optional) platformVersion; } - public Optional pushNotifications() { - return pushNotifications; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional pluginHost() { + return (Optional) pluginHost; } - public Optional readOnlyLibraries() { - return readOnlyLibraries; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional pushNotifications() { + return (Optional) pushNotifications; } - public Optional streamingBrainABRVersion() { - return streamingBrainABRVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional readOnlyLibraries() { + return (Optional) readOnlyLibraries; } - public Optional streamingBrainVersion() { - return streamingBrainVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional streamingBrainABRVersion() { + return (Optional) streamingBrainABRVersion; } - public Optional sync() { - return sync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional streamingBrainVersion() { + return (Optional) streamingBrainVersion; } - public Optional transcoderActiveVideoSessions() { - return transcoderActiveVideoSessions; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sync() { + return (Optional) sync; } - public Optional transcoderAudio() { - return transcoderAudio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional transcoderActiveVideoSessions() { + return (Optional) transcoderActiveVideoSessions; } - public Optional transcoderLyrics() { - return transcoderLyrics; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional transcoderAudio() { + return (Optional) transcoderAudio; } - public Optional transcoderPhoto() { - return transcoderPhoto; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional transcoderLyrics() { + return (Optional) transcoderLyrics; } - public Optional transcoderSubtitles() { - return transcoderSubtitles; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional transcoderPhoto() { + return (Optional) transcoderPhoto; } - public Optional transcoderVideo() { - return transcoderVideo; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional transcoderSubtitles() { + return (Optional) transcoderSubtitles; } - public Optional transcoderVideoBitrates() { - return transcoderVideoBitrates; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional transcoderVideo() { + return (Optional) transcoderVideo; } - public Optional transcoderVideoQualities() { - return transcoderVideoQualities; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional transcoderVideoBitrates() { + return (Optional) transcoderVideoBitrates; } - public Optional transcoderVideoResolutions() { - return transcoderVideoResolutions; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional transcoderVideoQualities() { + return (Optional) transcoderVideoQualities; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional transcoderVideoResolutions() { + return (Optional) transcoderVideoResolutions; } - public Optional updater() { - return updater; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } - public Optional version() { - return version; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updater() { + return (Optional) updater; } - public Optional voiceSearch() { - return voiceSearch; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional version() { + return (Optional) version; } - public Optional> directory() { - return directory; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional voiceSearch() { + return (Optional) voiceSearch; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> directory() { + return (Optional>) directory; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Metadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Metadata.java index cb172031..a3de4cb4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Metadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Metadata.java @@ -4,60 +4,75 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; -import java.time.OffsetDateTime; +import java.time.LocalDate; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Metadata { @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; + @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; @@ -67,389 +82,421 @@ public class Metadata { private Optional contentRating; @JsonInclude(Include.NON_ABSENT) - @JsonProperty("summary") - private Optional summary; + @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("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; + @JsonProperty("imdbRatingCount") + private Optional imdbRatingCount; @JsonInclude(Include.NON_ABSENT) - @JsonProperty("Genre") - private Optional> genre; + @JsonProperty("subtype") + private Optional subtype; @JsonInclude(Include.NON_ABSENT) - @JsonProperty("Director") - private Optional> director; + @JsonProperty("theme") + private Optional theme; @JsonInclude(Include.NON_ABSENT) - @JsonProperty("Writer") - private Optional> writer; + @JsonProperty("leafCount") + private Optional leafCount; @JsonInclude(Include.NON_ABSENT) - @JsonProperty("Country") - private Optional> country; + @JsonProperty("childCount") + private Optional childCount; @JsonInclude(Include.NON_ABSENT) - @JsonProperty("Role") - private Optional> role; + @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; + + @JsonCreator public Metadata( - @JsonProperty("allowSync") Optional allowSync, - @JsonProperty("librarySectionID") Optional librarySectionID, - @JsonProperty("librarySectionTitle") Optional librarySectionTitle, - @JsonProperty("librarySectionUUID") Optional librarySectionUUID, - @JsonProperty("ratingKey") Optional ratingKey, - @JsonProperty("key") Optional key, + @JsonProperty("art") Optional art, @JsonProperty("guid") Optional guid, + @JsonProperty("key") Optional key, + @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("studio") Optional studio, + @JsonProperty("tagline") Optional tagline, @JsonProperty("type") Optional type, + @JsonProperty("thumb") Optional thumb, + @JsonProperty("addedAt") Optional addedAt, + @JsonProperty("duration") Optional duration, + @JsonProperty("publicPagesURL") Optional publicPagesURL, + @JsonProperty("slug") Optional slug, + @JsonProperty("userState") Optional userState, @JsonProperty("title") Optional title, @JsonProperty("contentRating") Optional contentRating, - @JsonProperty("summary") Optional summary, + @JsonProperty("originallyAvailableAt") Optional originallyAvailableAt, + @JsonProperty("year") Optional year, + @JsonProperty("Image") Optional> image, + @JsonProperty("banner") Optional banner, @JsonProperty("rating") Optional rating, + @JsonProperty("expiresAt") Optional expiresAt, + @JsonProperty("originalTitle") Optional originalTitle, @JsonProperty("audienceRating") Optional audienceRating, - @JsonProperty("year") Optional year, - @JsonProperty("tagline") Optional tagline, - @JsonProperty("thumb") Optional thumb, - @JsonProperty("art") Optional art, - @JsonProperty("duration") Optional duration, - @JsonProperty("originallyAvailableAt") Optional originallyAvailableAt, - @JsonProperty("addedAt") Optional addedAt, - @JsonProperty("updatedAt") Optional updatedAt, @JsonProperty("audienceRatingImage") Optional audienceRatingImage, - @JsonProperty("chapterSource") Optional chapterSource, - @JsonProperty("primaryExtraKey") Optional primaryExtraKey, @JsonProperty("ratingImage") Optional ratingImage, - @JsonProperty("Media") Optional> media, - @JsonProperty("Genre") Optional> genre, - @JsonProperty("Director") Optional> director, - @JsonProperty("Writer") Optional> writer, - @JsonProperty("Country") Optional> country, - @JsonProperty("Role") Optional> role) { - Utils.checkNotNull(allowSync, "allowSync"); - Utils.checkNotNull(librarySectionID, "librarySectionID"); - Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); - Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); - Utils.checkNotNull(ratingKey, "ratingKey"); - Utils.checkNotNull(key, "key"); + @JsonProperty("imdbRatingCount") Optional imdbRatingCount, + @JsonProperty("subtype") Optional subtype, + @JsonProperty("theme") Optional theme, + @JsonProperty("leafCount") Optional leafCount, + @JsonProperty("childCount") Optional childCount, + @JsonProperty("isContinuingSeries") Optional isContinuingSeries, + @JsonProperty("skipChildren") Optional skipChildren, + @JsonProperty("availabilityId") Optional availabilityId, + @JsonProperty("streamingMediaId") Optional streamingMediaId, + @JsonProperty("playableKey") Optional playableKey) { + Utils.checkNotNull(art, "art"); Utils.checkNotNull(guid, "guid"); + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(ratingKey, "ratingKey"); Utils.checkNotNull(studio, "studio"); + Utils.checkNotNull(tagline, "tagline"); Utils.checkNotNull(type, "type"); + Utils.checkNotNull(thumb, "thumb"); + Utils.checkNotNull(addedAt, "addedAt"); + Utils.checkNotNull(duration, "duration"); + Utils.checkNotNull(publicPagesURL, "publicPagesURL"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(userState, "userState"); Utils.checkNotNull(title, "title"); Utils.checkNotNull(contentRating, "contentRating"); - Utils.checkNotNull(summary, "summary"); - Utils.checkNotNull(rating, "rating"); - Utils.checkNotNull(audienceRating, "audienceRating"); - Utils.checkNotNull(year, "year"); - Utils.checkNotNull(tagline, "tagline"); - Utils.checkNotNull(thumb, "thumb"); - Utils.checkNotNull(art, "art"); - Utils.checkNotNull(duration, "duration"); Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); - Utils.checkNotNull(addedAt, "addedAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(year, "year"); + Utils.checkNotNull(image, "image"); + Utils.checkNotNull(banner, "banner"); + Utils.checkNotNull(rating, "rating"); + Utils.checkNotNull(expiresAt, "expiresAt"); + Utils.checkNotNull(originalTitle, "originalTitle"); + Utils.checkNotNull(audienceRating, "audienceRating"); Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); - Utils.checkNotNull(chapterSource, "chapterSource"); - Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); Utils.checkNotNull(ratingImage, "ratingImage"); - Utils.checkNotNull(media, "media"); - Utils.checkNotNull(genre, "genre"); - Utils.checkNotNull(director, "director"); - Utils.checkNotNull(writer, "writer"); - Utils.checkNotNull(country, "country"); - Utils.checkNotNull(role, "role"); - this.allowSync = allowSync; - this.librarySectionID = librarySectionID; - this.librarySectionTitle = librarySectionTitle; - this.librarySectionUUID = librarySectionUUID; - this.ratingKey = ratingKey; - this.key = key; + Utils.checkNotNull(imdbRatingCount, "imdbRatingCount"); + Utils.checkNotNull(subtype, "subtype"); + Utils.checkNotNull(theme, "theme"); + Utils.checkNotNull(leafCount, "leafCount"); + Utils.checkNotNull(childCount, "childCount"); + Utils.checkNotNull(isContinuingSeries, "isContinuingSeries"); + Utils.checkNotNull(skipChildren, "skipChildren"); + Utils.checkNotNull(availabilityId, "availabilityId"); + Utils.checkNotNull(streamingMediaId, "streamingMediaId"); + Utils.checkNotNull(playableKey, "playableKey"); + this.art = art; this.guid = guid; + this.key = key; + this.ratingKey = ratingKey; this.studio = studio; + this.tagline = tagline; this.type = type; + this.thumb = thumb; + this.addedAt = addedAt; + this.duration = duration; + this.publicPagesURL = publicPagesURL; + this.slug = slug; + this.userState = userState; this.title = title; this.contentRating = contentRating; - this.summary = summary; - this.rating = rating; - this.audienceRating = audienceRating; - this.year = year; - this.tagline = tagline; - this.thumb = thumb; - this.art = art; - this.duration = duration; this.originallyAvailableAt = originallyAvailableAt; - this.addedAt = addedAt; - this.updatedAt = updatedAt; + this.year = year; + this.image = image; + this.banner = banner; + this.rating = rating; + this.expiresAt = expiresAt; + this.originalTitle = originalTitle; + this.audienceRating = audienceRating; this.audienceRatingImage = audienceRatingImage; - this.chapterSource = chapterSource; - this.primaryExtraKey = primaryExtraKey; this.ratingImage = ratingImage; - this.media = media; - this.genre = genre; - this.director = director; - this.writer = writer; - this.country = country; - this.role = role; + this.imdbRatingCount = imdbRatingCount; + this.subtype = subtype; + this.theme = theme; + this.leafCount = leafCount; + this.childCount = childCount; + this.isContinuingSeries = isContinuingSeries; + this.skipChildren = skipChildren; + this.availabilityId = availabilityId; + this.streamingMediaId = streamingMediaId; + this.playableKey = playableKey; + } + + 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()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional librarySectionID() { - return librarySectionID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional librarySectionTitle() { - return librarySectionTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional librarySectionUUID() { - return librarySectionUUID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional ratingKey() { - return ratingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional studio() { + return (Optional) studio; } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagline() { + return (Optional) tagline; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional studio() { - return studio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional contentRating() { - return contentRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicPagesURL() { + return (Optional) publicPagesURL; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional slug() { + return (Optional) slug; } - public Optional rating() { - return rating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userState() { + return (Optional) userState; } - public Optional audienceRating() { - return audienceRating; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional year() { - return year; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional contentRating() { + return (Optional) contentRating; } - public Optional tagline() { - return tagline; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originallyAvailableAt() { + return (Optional) originallyAvailableAt; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional year() { + return (Optional) year; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> image() { + return (Optional>) image; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional banner() { + return (Optional) banner; } - public Optional originallyAvailableAt() { - return originallyAvailableAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional rating() { + return (Optional) rating; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional expiresAt() { + return (Optional) expiresAt; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional originalTitle() { + return (Optional) originalTitle; } - public Optional audienceRatingImage() { - return audienceRatingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRating() { + return (Optional) audienceRating; } - public Optional chapterSource() { - return chapterSource; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audienceRatingImage() { + return (Optional) audienceRatingImage; } - public Optional primaryExtraKey() { - return primaryExtraKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingImage() { + return (Optional) ratingImage; } - public Optional ratingImage() { - return ratingImage; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional imdbRatingCount() { + return (Optional) imdbRatingCount; } - public Optional> media() { - return media; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subtype() { + return (Optional) subtype; } - public Optional> genre() { - return genre; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional theme() { + return (Optional) theme; } - public Optional> director() { - return director; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional leafCount() { + return (Optional) leafCount; } - public Optional> writer() { - return writer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional childCount() { + return (Optional) childCount; } - public Optional> country() { - return country; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional isContinuingSeries() { + return (Optional) isContinuingSeries; } - public Optional> role() { - return role; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional skipChildren() { + return (Optional) skipChildren; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional availabilityId() { + return (Optional) availabilityId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional streamingMediaId() { + return (Optional) streamingMediaId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional playableKey() { + return (Optional) playableKey; } public final static Builder builder() { return new Builder(); } - public Metadata withAllowSync(boolean allowSync) { - Utils.checkNotNull(allowSync, "allowSync"); - this.allowSync = Optional.ofNullable(allowSync); + public Metadata withArt(String art) { + Utils.checkNotNull(art, "art"); + this.art = Optional.ofNullable(art); return this; } - public Metadata withAllowSync(Optional allowSync) { - Utils.checkNotNull(allowSync, "allowSync"); - this.allowSync = allowSync; - return this; - } - - public Metadata withLibrarySectionID(double librarySectionID) { - Utils.checkNotNull(librarySectionID, "librarySectionID"); - this.librarySectionID = Optional.ofNullable(librarySectionID); - return this; - } - - public Metadata withLibrarySectionID(Optional librarySectionID) { - Utils.checkNotNull(librarySectionID, "librarySectionID"); - this.librarySectionID = librarySectionID; - return this; - } - - public Metadata withLibrarySectionTitle(String librarySectionTitle) { - Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); - this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); - return this; - } - - public Metadata withLibrarySectionTitle(Optional librarySectionTitle) { - Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); - this.librarySectionTitle = librarySectionTitle; - return this; - } - - public Metadata withLibrarySectionUUID(String librarySectionUUID) { - Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); - this.librarySectionUUID = Optional.ofNullable(librarySectionUUID); - return this; - } - - public Metadata withLibrarySectionUUID(Optional librarySectionUUID) { - Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); - this.librarySectionUUID = librarySectionUUID; - return this; - } - - public Metadata withRatingKey(double ratingKey) { - Utils.checkNotNull(ratingKey, "ratingKey"); - this.ratingKey = Optional.ofNullable(ratingKey); - return this; - } - - public Metadata withRatingKey(Optional ratingKey) { - Utils.checkNotNull(ratingKey, "ratingKey"); - this.ratingKey = ratingKey; - return this; - } - - public Metadata withKey(String key) { - Utils.checkNotNull(key, "key"); - this.key = Optional.ofNullable(key); - return this; - } - - public Metadata withKey(Optional key) { - Utils.checkNotNull(key, "key"); - this.key = key; + public Metadata withArt(Optional art) { + Utils.checkNotNull(art, "art"); + this.art = art; return this; } @@ -465,6 +512,30 @@ public class Metadata { return this; } + public Metadata withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = Optional.ofNullable(key); + return this; + } + + public Metadata withKey(Optional key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Metadata withRatingKey(String ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = Optional.ofNullable(ratingKey); + return this; + } + + public Metadata withRatingKey(Optional ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + public Metadata withStudio(String studio) { Utils.checkNotNull(studio, "studio"); this.studio = Optional.ofNullable(studio); @@ -477,6 +548,18 @@ public class Metadata { return this; } + public Metadata withTagline(String tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = Optional.ofNullable(tagline); + return this; + } + + public Metadata withTagline(Optional tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = tagline; + return this; + } + public Metadata withType(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -489,6 +572,78 @@ public class Metadata { return this; } + public Metadata withThumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public Metadata withThumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public Metadata withAddedAt(int addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = Optional.ofNullable(addedAt); + return this; + } + + public Metadata withAddedAt(Optional addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = addedAt; + return this; + } + + public Metadata withDuration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Metadata withDuration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public Metadata withPublicPagesURL(String publicPagesURL) { + Utils.checkNotNull(publicPagesURL, "publicPagesURL"); + this.publicPagesURL = Optional.ofNullable(publicPagesURL); + return this; + } + + public Metadata withPublicPagesURL(Optional publicPagesURL) { + Utils.checkNotNull(publicPagesURL, "publicPagesURL"); + this.publicPagesURL = publicPagesURL; + return this; + } + + public Metadata withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + public Metadata withSlug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Metadata withUserState(boolean userState) { + Utils.checkNotNull(userState, "userState"); + this.userState = Optional.ofNullable(userState); + return this; + } + + public Metadata withUserState(Optional userState) { + Utils.checkNotNull(userState, "userState"); + this.userState = userState; + return this; + } + public Metadata withTitle(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -513,15 +668,51 @@ public class Metadata { return this; } - public Metadata withSummary(String summary) { - Utils.checkNotNull(summary, "summary"); - this.summary = Optional.ofNullable(summary); + public Metadata withOriginallyAvailableAt(LocalDate originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); return this; } - public Metadata withSummary(Optional summary) { - Utils.checkNotNull(summary, "summary"); - this.summary = summary; + public Metadata withOriginallyAvailableAt(Optional originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = originallyAvailableAt; + return this; + } + + public Metadata withYear(int year) { + Utils.checkNotNull(year, "year"); + this.year = Optional.ofNullable(year); + return this; + } + + public Metadata withYear(Optional year) { + Utils.checkNotNull(year, "year"); + this.year = year; + return this; + } + + public Metadata withImage(java.util.List image) { + Utils.checkNotNull(image, "image"); + this.image = Optional.ofNullable(image); + return this; + } + + public Metadata withImage(Optional> image) { + Utils.checkNotNull(image, "image"); + this.image = image; + return this; + } + + public Metadata withBanner(String banner) { + Utils.checkNotNull(banner, "banner"); + this.banner = Optional.ofNullable(banner); + return this; + } + + public Metadata withBanner(Optional banner) { + Utils.checkNotNull(banner, "banner"); + this.banner = banner; return this; } @@ -537,6 +728,30 @@ public class Metadata { return this; } + public Metadata withExpiresAt(int expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + public Metadata withExpiresAt(Optional expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = expiresAt; + return this; + } + + public Metadata withOriginalTitle(String originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = Optional.ofNullable(originalTitle); + return this; + } + + public Metadata withOriginalTitle(Optional originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = originalTitle; + return this; + } + public Metadata withAudienceRating(double audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = Optional.ofNullable(audienceRating); @@ -549,102 +764,6 @@ public class Metadata { return this; } - public Metadata withYear(double year) { - Utils.checkNotNull(year, "year"); - this.year = Optional.ofNullable(year); - return this; - } - - public Metadata withYear(Optional year) { - Utils.checkNotNull(year, "year"); - this.year = year; - return this; - } - - public Metadata withTagline(String tagline) { - Utils.checkNotNull(tagline, "tagline"); - this.tagline = Optional.ofNullable(tagline); - return this; - } - - public Metadata withTagline(Optional tagline) { - Utils.checkNotNull(tagline, "tagline"); - this.tagline = tagline; - return this; - } - - public Metadata withThumb(String thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = Optional.ofNullable(thumb); - return this; - } - - public Metadata withThumb(Optional thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = thumb; - return this; - } - - public Metadata withArt(String art) { - Utils.checkNotNull(art, "art"); - this.art = Optional.ofNullable(art); - return this; - } - - public Metadata withArt(Optional art) { - Utils.checkNotNull(art, "art"); - this.art = art; - return this; - } - - public Metadata withDuration(double duration) { - Utils.checkNotNull(duration, "duration"); - this.duration = Optional.ofNullable(duration); - return this; - } - - public Metadata withDuration(Optional duration) { - Utils.checkNotNull(duration, "duration"); - this.duration = duration; - return this; - } - - public Metadata withOriginallyAvailableAt(OffsetDateTime originallyAvailableAt) { - Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); - this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); - return this; - } - - public Metadata withOriginallyAvailableAt(Optional originallyAvailableAt) { - Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); - this.originallyAvailableAt = originallyAvailableAt; - return this; - } - - public Metadata withAddedAt(double addedAt) { - Utils.checkNotNull(addedAt, "addedAt"); - this.addedAt = Optional.ofNullable(addedAt); - return this; - } - - public Metadata withAddedAt(Optional addedAt) { - Utils.checkNotNull(addedAt, "addedAt"); - this.addedAt = addedAt; - return this; - } - - public Metadata withUpdatedAt(double updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = Optional.ofNullable(updatedAt); - return this; - } - - public Metadata withUpdatedAt(Optional updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - public Metadata withAudienceRatingImage(String audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); @@ -657,30 +776,6 @@ public class Metadata { return this; } - public Metadata withChapterSource(String chapterSource) { - Utils.checkNotNull(chapterSource, "chapterSource"); - this.chapterSource = Optional.ofNullable(chapterSource); - return this; - } - - public Metadata withChapterSource(Optional chapterSource) { - Utils.checkNotNull(chapterSource, "chapterSource"); - this.chapterSource = chapterSource; - return this; - } - - public Metadata withPrimaryExtraKey(String primaryExtraKey) { - Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); - this.primaryExtraKey = Optional.ofNullable(primaryExtraKey); - return this; - } - - public Metadata withPrimaryExtraKey(Optional primaryExtraKey) { - Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); - this.primaryExtraKey = primaryExtraKey; - return this; - } - public Metadata withRatingImage(String ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = Optional.ofNullable(ratingImage); @@ -693,75 +788,123 @@ public class Metadata { return this; } - public Metadata withMedia(java.util.List media) { - Utils.checkNotNull(media, "media"); - this.media = Optional.ofNullable(media); + public Metadata withImdbRatingCount(int imdbRatingCount) { + Utils.checkNotNull(imdbRatingCount, "imdbRatingCount"); + this.imdbRatingCount = Optional.ofNullable(imdbRatingCount); return this; } - public Metadata withMedia(Optional> media) { - Utils.checkNotNull(media, "media"); - this.media = media; + public Metadata withImdbRatingCount(Optional imdbRatingCount) { + Utils.checkNotNull(imdbRatingCount, "imdbRatingCount"); + this.imdbRatingCount = imdbRatingCount; return this; } - public Metadata withGenre(java.util.List genre) { - Utils.checkNotNull(genre, "genre"); - this.genre = Optional.ofNullable(genre); + public Metadata withSubtype(String subtype) { + Utils.checkNotNull(subtype, "subtype"); + this.subtype = Optional.ofNullable(subtype); return this; } - public Metadata withGenre(Optional> genre) { - Utils.checkNotNull(genre, "genre"); - this.genre = genre; + public Metadata withSubtype(Optional subtype) { + Utils.checkNotNull(subtype, "subtype"); + this.subtype = subtype; return this; } - public Metadata withDirector(java.util.List director) { - Utils.checkNotNull(director, "director"); - this.director = Optional.ofNullable(director); + public Metadata withTheme(String theme) { + Utils.checkNotNull(theme, "theme"); + this.theme = Optional.ofNullable(theme); return this; } - public Metadata withDirector(Optional> director) { - Utils.checkNotNull(director, "director"); - this.director = director; + public Metadata withTheme(Optional theme) { + Utils.checkNotNull(theme, "theme"); + this.theme = theme; return this; } - public Metadata withWriter(java.util.List writer) { - Utils.checkNotNull(writer, "writer"); - this.writer = Optional.ofNullable(writer); + public Metadata withLeafCount(int leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = Optional.ofNullable(leafCount); return this; } - public Metadata withWriter(Optional> writer) { - Utils.checkNotNull(writer, "writer"); - this.writer = writer; + public Metadata withLeafCount(Optional leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = leafCount; return this; } - public Metadata withCountry(java.util.List country) { - Utils.checkNotNull(country, "country"); - this.country = Optional.ofNullable(country); + public Metadata withChildCount(int childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = Optional.ofNullable(childCount); return this; } - public Metadata withCountry(Optional> country) { - Utils.checkNotNull(country, "country"); - this.country = country; + public Metadata withChildCount(Optional childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = childCount; return this; } - public Metadata withRole(java.util.List role) { - Utils.checkNotNull(role, "role"); - this.role = Optional.ofNullable(role); + public Metadata withIsContinuingSeries(boolean isContinuingSeries) { + Utils.checkNotNull(isContinuingSeries, "isContinuingSeries"); + this.isContinuingSeries = Optional.ofNullable(isContinuingSeries); return this; } - public Metadata withRole(Optional> role) { - Utils.checkNotNull(role, "role"); - this.role = role; + public Metadata withIsContinuingSeries(Optional isContinuingSeries) { + Utils.checkNotNull(isContinuingSeries, "isContinuingSeries"); + this.isContinuingSeries = isContinuingSeries; + return this; + } + + public Metadata withSkipChildren(boolean skipChildren) { + Utils.checkNotNull(skipChildren, "skipChildren"); + this.skipChildren = Optional.ofNullable(skipChildren); + return this; + } + + public Metadata withSkipChildren(Optional skipChildren) { + Utils.checkNotNull(skipChildren, "skipChildren"); + this.skipChildren = skipChildren; + return this; + } + + public Metadata withAvailabilityId(String availabilityId) { + Utils.checkNotNull(availabilityId, "availabilityId"); + this.availabilityId = Optional.ofNullable(availabilityId); + return this; + } + + public Metadata withAvailabilityId(Optional availabilityId) { + Utils.checkNotNull(availabilityId, "availabilityId"); + this.availabilityId = availabilityId; + return this; + } + + public Metadata withStreamingMediaId(String streamingMediaId) { + Utils.checkNotNull(streamingMediaId, "streamingMediaId"); + this.streamingMediaId = Optional.ofNullable(streamingMediaId); + return this; + } + + public Metadata withStreamingMediaId(Optional streamingMediaId) { + Utils.checkNotNull(streamingMediaId, "streamingMediaId"); + this.streamingMediaId = streamingMediaId; + return this; + } + + public Metadata withPlayableKey(String playableKey) { + Utils.checkNotNull(playableKey, "playableKey"); + this.playableKey = Optional.ofNullable(playableKey); + return this; + } + + public Metadata withPlayableKey(Optional playableKey) { + Utils.checkNotNull(playableKey, "playableKey"); + this.playableKey = playableKey; return this; } @@ -775,253 +918,208 @@ public class Metadata { } Metadata other = (Metadata) o; return - java.util.Objects.deepEquals(this.allowSync, other.allowSync) && - java.util.Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - java.util.Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - java.util.Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) && - java.util.Objects.deepEquals(this.ratingKey, other.ratingKey) && - java.util.Objects.deepEquals(this.key, other.key) && + java.util.Objects.deepEquals(this.art, other.art) && java.util.Objects.deepEquals(this.guid, other.guid) && + java.util.Objects.deepEquals(this.key, other.key) && + java.util.Objects.deepEquals(this.ratingKey, other.ratingKey) && java.util.Objects.deepEquals(this.studio, other.studio) && + java.util.Objects.deepEquals(this.tagline, other.tagline) && java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.thumb, other.thumb) && + java.util.Objects.deepEquals(this.addedAt, other.addedAt) && + java.util.Objects.deepEquals(this.duration, other.duration) && + java.util.Objects.deepEquals(this.publicPagesURL, other.publicPagesURL) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.userState, other.userState) && java.util.Objects.deepEquals(this.title, other.title) && java.util.Objects.deepEquals(this.contentRating, other.contentRating) && - java.util.Objects.deepEquals(this.summary, other.summary) && - java.util.Objects.deepEquals(this.rating, other.rating) && - java.util.Objects.deepEquals(this.audienceRating, other.audienceRating) && - java.util.Objects.deepEquals(this.year, other.year) && - java.util.Objects.deepEquals(this.tagline, other.tagline) && - java.util.Objects.deepEquals(this.thumb, other.thumb) && - java.util.Objects.deepEquals(this.art, other.art) && - java.util.Objects.deepEquals(this.duration, other.duration) && java.util.Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - java.util.Objects.deepEquals(this.addedAt, other.addedAt) && - java.util.Objects.deepEquals(this.updatedAt, other.updatedAt) && + java.util.Objects.deepEquals(this.year, other.year) && + java.util.Objects.deepEquals(this.image, other.image) && + java.util.Objects.deepEquals(this.banner, other.banner) && + java.util.Objects.deepEquals(this.rating, other.rating) && + java.util.Objects.deepEquals(this.expiresAt, other.expiresAt) && + java.util.Objects.deepEquals(this.originalTitle, other.originalTitle) && + java.util.Objects.deepEquals(this.audienceRating, other.audienceRating) && java.util.Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - java.util.Objects.deepEquals(this.chapterSource, other.chapterSource) && - java.util.Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && java.util.Objects.deepEquals(this.ratingImage, other.ratingImage) && - java.util.Objects.deepEquals(this.media, other.media) && - java.util.Objects.deepEquals(this.genre, other.genre) && - java.util.Objects.deepEquals(this.director, other.director) && - java.util.Objects.deepEquals(this.writer, other.writer) && - java.util.Objects.deepEquals(this.country, other.country) && - java.util.Objects.deepEquals(this.role, other.role); + java.util.Objects.deepEquals(this.imdbRatingCount, other.imdbRatingCount) && + java.util.Objects.deepEquals(this.subtype, other.subtype) && + java.util.Objects.deepEquals(this.theme, other.theme) && + java.util.Objects.deepEquals(this.leafCount, other.leafCount) && + java.util.Objects.deepEquals(this.childCount, other.childCount) && + java.util.Objects.deepEquals(this.isContinuingSeries, other.isContinuingSeries) && + java.util.Objects.deepEquals(this.skipChildren, other.skipChildren) && + java.util.Objects.deepEquals(this.availabilityId, other.availabilityId) && + java.util.Objects.deepEquals(this.streamingMediaId, other.streamingMediaId) && + java.util.Objects.deepEquals(this.playableKey, other.playableKey); } @Override public int hashCode() { return java.util.Objects.hash( - allowSync, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - ratingKey, - key, + art, guid, + key, + ratingKey, studio, + tagline, type, + thumb, + addedAt, + duration, + publicPagesURL, + slug, + userState, title, contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - duration, originallyAvailableAt, - addedAt, - updatedAt, + year, + image, + banner, + rating, + expiresAt, + originalTitle, + audienceRating, audienceRatingImage, - chapterSource, - primaryExtraKey, ratingImage, - media, - genre, - director, - writer, - country, - role); + imdbRatingCount, + subtype, + theme, + leafCount, + childCount, + isContinuingSeries, + skipChildren, + availabilityId, + streamingMediaId, + playableKey); } @Override public String toString() { return Utils.toString(Metadata.class, - "allowSync", allowSync, - "librarySectionID", librarySectionID, - "librarySectionTitle", librarySectionTitle, - "librarySectionUUID", librarySectionUUID, - "ratingKey", ratingKey, - "key", key, + "art", art, "guid", guid, + "key", key, + "ratingKey", ratingKey, "studio", studio, + "tagline", tagline, "type", type, + "thumb", thumb, + "addedAt", addedAt, + "duration", duration, + "publicPagesURL", publicPagesURL, + "slug", slug, + "userState", userState, "title", title, "contentRating", contentRating, - "summary", summary, - "rating", rating, - "audienceRating", audienceRating, - "year", year, - "tagline", tagline, - "thumb", thumb, - "art", art, - "duration", duration, "originallyAvailableAt", originallyAvailableAt, - "addedAt", addedAt, - "updatedAt", updatedAt, + "year", year, + "image", image, + "banner", banner, + "rating", rating, + "expiresAt", expiresAt, + "originalTitle", originalTitle, + "audienceRating", audienceRating, "audienceRatingImage", audienceRatingImage, - "chapterSource", chapterSource, - "primaryExtraKey", primaryExtraKey, "ratingImage", ratingImage, - "media", media, - "genre", genre, - "director", director, - "writer", writer, - "country", country, - "role", role); + "imdbRatingCount", imdbRatingCount, + "subtype", subtype, + "theme", theme, + "leafCount", leafCount, + "childCount", childCount, + "isContinuingSeries", isContinuingSeries, + "skipChildren", skipChildren, + "availabilityId", availabilityId, + "streamingMediaId", streamingMediaId, + "playableKey", playableKey); } 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 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 summary = 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 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 imdbRatingCount = Optional.empty(); - private Optional> genre = Optional.empty(); + private Optional subtype = Optional.empty(); - private Optional> director = Optional.empty(); + private Optional theme = Optional.empty(); - private Optional> writer = Optional.empty(); + private Optional leafCount = Optional.empty(); - private Optional> country = Optional.empty(); + private Optional childCount = Optional.empty(); - private Optional> role = 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 allowSync(boolean allowSync) { - Utils.checkNotNull(allowSync, "allowSync"); - this.allowSync = Optional.ofNullable(allowSync); + public Builder art(String art) { + Utils.checkNotNull(art, "art"); + this.art = Optional.ofNullable(art); return this; } - public Builder allowSync(Optional allowSync) { - Utils.checkNotNull(allowSync, "allowSync"); - this.allowSync = allowSync; - return this; - } - - public Builder librarySectionID(double librarySectionID) { - Utils.checkNotNull(librarySectionID, "librarySectionID"); - this.librarySectionID = Optional.ofNullable(librarySectionID); - return this; - } - - public Builder librarySectionID(Optional librarySectionID) { - Utils.checkNotNull(librarySectionID, "librarySectionID"); - this.librarySectionID = librarySectionID; - return this; - } - - public Builder librarySectionTitle(String librarySectionTitle) { - Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); - this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); - return this; - } - - public Builder librarySectionTitle(Optional librarySectionTitle) { - Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); - this.librarySectionTitle = librarySectionTitle; - return this; - } - - public Builder librarySectionUUID(String librarySectionUUID) { - Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); - this.librarySectionUUID = Optional.ofNullable(librarySectionUUID); - return this; - } - - public Builder librarySectionUUID(Optional librarySectionUUID) { - Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); - this.librarySectionUUID = librarySectionUUID; - return this; - } - - public Builder ratingKey(double ratingKey) { - Utils.checkNotNull(ratingKey, "ratingKey"); - this.ratingKey = Optional.ofNullable(ratingKey); - return this; - } - - public Builder ratingKey(Optional ratingKey) { - Utils.checkNotNull(ratingKey, "ratingKey"); - this.ratingKey = ratingKey; - return this; - } - - public Builder key(String key) { - Utils.checkNotNull(key, "key"); - this.key = Optional.ofNullable(key); - return this; - } - - public Builder key(Optional key) { - Utils.checkNotNull(key, "key"); - this.key = key; + public Builder art(Optional art) { + Utils.checkNotNull(art, "art"); + this.art = art; return this; } @@ -1037,6 +1135,30 @@ public class Metadata { return this; } + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = Optional.ofNullable(key); + return this; + } + + public Builder key(Optional key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder ratingKey(String ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = Optional.ofNullable(ratingKey); + return this; + } + + public Builder ratingKey(Optional ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + public Builder studio(String studio) { Utils.checkNotNull(studio, "studio"); this.studio = Optional.ofNullable(studio); @@ -1049,6 +1171,18 @@ public class Metadata { return this; } + public Builder tagline(String tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = Optional.ofNullable(tagline); + return this; + } + + public Builder tagline(Optional tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = tagline; + return this; + } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -1061,6 +1195,78 @@ public class Metadata { return this; } + public Builder thumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public Builder thumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public Builder addedAt(int addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = Optional.ofNullable(addedAt); + return this; + } + + public Builder addedAt(Optional addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = addedAt; + return this; + } + + public Builder duration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Builder duration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public Builder publicPagesURL(String publicPagesURL) { + Utils.checkNotNull(publicPagesURL, "publicPagesURL"); + this.publicPagesURL = Optional.ofNullable(publicPagesURL); + return this; + } + + public Builder publicPagesURL(Optional publicPagesURL) { + Utils.checkNotNull(publicPagesURL, "publicPagesURL"); + this.publicPagesURL = publicPagesURL; + return this; + } + + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + public Builder slug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Builder userState(boolean userState) { + Utils.checkNotNull(userState, "userState"); + this.userState = Optional.ofNullable(userState); + return this; + } + + public Builder userState(Optional userState) { + Utils.checkNotNull(userState, "userState"); + this.userState = userState; + return this; + } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -1085,15 +1291,51 @@ public class Metadata { return this; } - public Builder summary(String summary) { - Utils.checkNotNull(summary, "summary"); - this.summary = Optional.ofNullable(summary); + public Builder originallyAvailableAt(LocalDate originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); return this; } - public Builder summary(Optional summary) { - Utils.checkNotNull(summary, "summary"); - this.summary = summary; + public Builder originallyAvailableAt(Optional originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = originallyAvailableAt; + return this; + } + + public Builder year(int year) { + Utils.checkNotNull(year, "year"); + this.year = Optional.ofNullable(year); + return this; + } + + public Builder year(Optional year) { + Utils.checkNotNull(year, "year"); + this.year = year; + return this; + } + + public Builder image(java.util.List image) { + Utils.checkNotNull(image, "image"); + this.image = Optional.ofNullable(image); + return this; + } + + public Builder image(Optional> image) { + Utils.checkNotNull(image, "image"); + this.image = image; + return this; + } + + public Builder banner(String banner) { + Utils.checkNotNull(banner, "banner"); + this.banner = Optional.ofNullable(banner); + return this; + } + + public Builder banner(Optional banner) { + Utils.checkNotNull(banner, "banner"); + this.banner = banner; return this; } @@ -1109,6 +1351,30 @@ public class Metadata { return this; } + public Builder expiresAt(int expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + public Builder expiresAt(Optional expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = expiresAt; + return this; + } + + public Builder originalTitle(String originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = Optional.ofNullable(originalTitle); + return this; + } + + public Builder originalTitle(Optional originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = originalTitle; + return this; + } + public Builder audienceRating(double audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = Optional.ofNullable(audienceRating); @@ -1121,102 +1387,6 @@ public class Metadata { return this; } - public Builder year(double year) { - Utils.checkNotNull(year, "year"); - this.year = Optional.ofNullable(year); - return this; - } - - public Builder year(Optional year) { - Utils.checkNotNull(year, "year"); - this.year = year; - return this; - } - - public Builder tagline(String tagline) { - Utils.checkNotNull(tagline, "tagline"); - this.tagline = Optional.ofNullable(tagline); - return this; - } - - public Builder tagline(Optional tagline) { - Utils.checkNotNull(tagline, "tagline"); - this.tagline = tagline; - return this; - } - - public Builder thumb(String thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = Optional.ofNullable(thumb); - return this; - } - - public Builder thumb(Optional thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = thumb; - return this; - } - - public Builder art(String art) { - Utils.checkNotNull(art, "art"); - this.art = Optional.ofNullable(art); - return this; - } - - public Builder art(Optional art) { - Utils.checkNotNull(art, "art"); - this.art = art; - return this; - } - - public Builder duration(double duration) { - Utils.checkNotNull(duration, "duration"); - this.duration = Optional.ofNullable(duration); - return this; - } - - public Builder duration(Optional duration) { - Utils.checkNotNull(duration, "duration"); - this.duration = duration; - return this; - } - - public Builder originallyAvailableAt(OffsetDateTime originallyAvailableAt) { - Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); - this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); - return this; - } - - public Builder originallyAvailableAt(Optional originallyAvailableAt) { - Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); - this.originallyAvailableAt = originallyAvailableAt; - return this; - } - - public Builder addedAt(double addedAt) { - Utils.checkNotNull(addedAt, "addedAt"); - this.addedAt = Optional.ofNullable(addedAt); - return this; - } - - public Builder addedAt(Optional addedAt) { - Utils.checkNotNull(addedAt, "addedAt"); - this.addedAt = addedAt; - return this; - } - - public Builder updatedAt(double updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = Optional.ofNullable(updatedAt); - return this; - } - - public Builder updatedAt(Optional updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - public Builder audienceRatingImage(String audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); @@ -1229,30 +1399,6 @@ public class Metadata { return this; } - public Builder chapterSource(String chapterSource) { - Utils.checkNotNull(chapterSource, "chapterSource"); - this.chapterSource = Optional.ofNullable(chapterSource); - return this; - } - - public Builder chapterSource(Optional chapterSource) { - Utils.checkNotNull(chapterSource, "chapterSource"); - this.chapterSource = chapterSource; - return this; - } - - public Builder primaryExtraKey(String primaryExtraKey) { - Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); - this.primaryExtraKey = Optional.ofNullable(primaryExtraKey); - return this; - } - - public Builder primaryExtraKey(Optional primaryExtraKey) { - Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); - this.primaryExtraKey = primaryExtraKey; - return this; - } - public Builder ratingImage(String ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = Optional.ofNullable(ratingImage); @@ -1265,112 +1411,163 @@ public class Metadata { return this; } - public Builder media(java.util.List media) { - Utils.checkNotNull(media, "media"); - this.media = Optional.ofNullable(media); + public Builder imdbRatingCount(int imdbRatingCount) { + Utils.checkNotNull(imdbRatingCount, "imdbRatingCount"); + this.imdbRatingCount = Optional.ofNullable(imdbRatingCount); return this; } - public Builder media(Optional> media) { - Utils.checkNotNull(media, "media"); - this.media = media; + public Builder imdbRatingCount(Optional imdbRatingCount) { + Utils.checkNotNull(imdbRatingCount, "imdbRatingCount"); + this.imdbRatingCount = imdbRatingCount; return this; } - public Builder genre(java.util.List genre) { - Utils.checkNotNull(genre, "genre"); - this.genre = Optional.ofNullable(genre); + public Builder subtype(String subtype) { + Utils.checkNotNull(subtype, "subtype"); + this.subtype = Optional.ofNullable(subtype); return this; } - public Builder genre(Optional> genre) { - Utils.checkNotNull(genre, "genre"); - this.genre = genre; + public Builder subtype(Optional subtype) { + Utils.checkNotNull(subtype, "subtype"); + this.subtype = subtype; return this; } - public Builder director(java.util.List director) { - Utils.checkNotNull(director, "director"); - this.director = Optional.ofNullable(director); + public Builder theme(String theme) { + Utils.checkNotNull(theme, "theme"); + this.theme = Optional.ofNullable(theme); return this; } - public Builder director(Optional> director) { - Utils.checkNotNull(director, "director"); - this.director = director; + public Builder theme(Optional theme) { + Utils.checkNotNull(theme, "theme"); + this.theme = theme; return this; } - public Builder writer(java.util.List writer) { - Utils.checkNotNull(writer, "writer"); - this.writer = Optional.ofNullable(writer); + public Builder leafCount(int leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = Optional.ofNullable(leafCount); return this; } - public Builder writer(Optional> writer) { - Utils.checkNotNull(writer, "writer"); - this.writer = writer; + public Builder leafCount(Optional leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = leafCount; return this; } - public Builder country(java.util.List country) { - Utils.checkNotNull(country, "country"); - this.country = Optional.ofNullable(country); + public Builder childCount(int childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = Optional.ofNullable(childCount); return this; } - public Builder country(Optional> country) { - Utils.checkNotNull(country, "country"); - this.country = country; + public Builder childCount(Optional childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = childCount; return this; } - public Builder role(java.util.List role) { - Utils.checkNotNull(role, "role"); - this.role = Optional.ofNullable(role); + public Builder isContinuingSeries(boolean isContinuingSeries) { + Utils.checkNotNull(isContinuingSeries, "isContinuingSeries"); + this.isContinuingSeries = Optional.ofNullable(isContinuingSeries); return this; } - public Builder role(Optional> role) { - Utils.checkNotNull(role, "role"); - this.role = role; + public Builder isContinuingSeries(Optional isContinuingSeries) { + Utils.checkNotNull(isContinuingSeries, "isContinuingSeries"); + this.isContinuingSeries = isContinuingSeries; + return this; + } + + public Builder skipChildren(boolean skipChildren) { + Utils.checkNotNull(skipChildren, "skipChildren"); + this.skipChildren = Optional.ofNullable(skipChildren); + return this; + } + + public Builder skipChildren(Optional skipChildren) { + Utils.checkNotNull(skipChildren, "skipChildren"); + this.skipChildren = skipChildren; + return this; + } + + public Builder availabilityId(String availabilityId) { + Utils.checkNotNull(availabilityId, "availabilityId"); + this.availabilityId = Optional.ofNullable(availabilityId); + return this; + } + + public Builder availabilityId(Optional availabilityId) { + Utils.checkNotNull(availabilityId, "availabilityId"); + this.availabilityId = availabilityId; + return this; + } + + public Builder streamingMediaId(String streamingMediaId) { + Utils.checkNotNull(streamingMediaId, "streamingMediaId"); + this.streamingMediaId = Optional.ofNullable(streamingMediaId); + return this; + } + + public Builder streamingMediaId(Optional streamingMediaId) { + Utils.checkNotNull(streamingMediaId, "streamingMediaId"); + this.streamingMediaId = streamingMediaId; + return this; + } + + public Builder playableKey(String playableKey) { + Utils.checkNotNull(playableKey, "playableKey"); + this.playableKey = Optional.ofNullable(playableKey); + return this; + } + + public Builder playableKey(Optional playableKey) { + Utils.checkNotNull(playableKey, "playableKey"); + this.playableKey = playableKey; return this; } public Metadata build() { return new Metadata( - allowSync, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - ratingKey, - key, + art, guid, + key, + ratingKey, studio, + tagline, type, + thumb, + addedAt, + duration, + publicPagesURL, + slug, + userState, title, contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - duration, originallyAvailableAt, - addedAt, - updatedAt, + year, + image, + banner, + rating, + expiresAt, + originalTitle, + audienceRating, audienceRatingImage, - chapterSource, - primaryExtraKey, ratingImage, - media, - genre, - director, - writer, - country, - role); + imdbRatingCount, + subtype, + theme, + leafCount, + childCount, + isContinuingSeries, + skipChildren, + availabilityId, + streamingMediaId, + playableKey); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MinSize.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MinSize.java index 0a059487..a0816795 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MinSize.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MinSize.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MyPlex.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MyPlex.java index 08215f12..aa8ff65a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/MyPlex.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/MyPlex.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class MyPlex { @JsonInclude(Include.NON_ABSENT) @@ -67,6 +68,7 @@ public class MyPlex { @JsonProperty("subscriptionState") private Optional subscriptionState; + @JsonCreator public MyPlex( @JsonProperty("authToken") Optional authToken, @JsonProperty("username") Optional username, @@ -105,53 +107,81 @@ public class MyPlex { this.subscriptionActive = subscriptionActive; this.subscriptionState = subscriptionState; } - - public Optional authToken() { - return authToken; + + 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()); } - public Optional username() { - return username; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional authToken() { + return (Optional) authToken; } - public Optional mappingState() { - return mappingState; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional username() { + return (Optional) username; } - public Optional mappingError() { - return mappingError; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mappingState() { + return (Optional) mappingState; } - public Optional signInState() { - return signInState; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mappingError() { + return (Optional) mappingError; } - public Optional publicAddress() { - return publicAddress; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional signInState() { + return (Optional) signInState; } - public Optional publicPort() { - return publicPort; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicAddress() { + return (Optional) publicAddress; } - public Optional privateAddress() { - return privateAddress; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicPort() { + return (Optional) publicPort; } - public Optional privatePort() { - return privatePort; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateAddress() { + return (Optional) privateAddress; } - public Optional subscriptionFeatures() { - return subscriptionFeatures; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privatePort() { + return (Optional) privatePort; } - public Optional subscriptionActive() { - return subscriptionActive; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subscriptionFeatures() { + return (Optional) subscriptionFeatures; } - public Optional subscriptionState() { - return subscriptionState; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subscriptionActive() { + return (Optional) subscriptionActive; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subscriptionState() { + return (Optional) subscriptionState; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/OnlyTransient.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/OnlyTransient.java index cd27c0f1..b4d4cddf 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/OnlyTransient.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/OnlyTransient.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Operator.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Operator.java index 71a2dfe6..cdb5bded 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Operator.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Operator.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Operator { @JsonInclude(Include.NON_ABSENT) @@ -27,6 +28,7 @@ public class Operator { @JsonProperty("title") private Optional title; + @JsonCreator public Operator( @JsonProperty("key") Optional key, @JsonProperty("title") Optional title) { @@ -35,13 +37,21 @@ public class Operator { this.key = key; this.title = title; } - - public Optional key() { - return key; + + public Operator() { + this(Optional.empty(), Optional.empty()); } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Part.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Part.java index 5c4a71a2..f645d1e9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Part.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Part.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Part { @JsonInclude(Include.NON_ABSENT) @@ -59,6 +60,7 @@ public class Part { @JsonProperty("videoProfile") private Optional videoProfile; + @JsonCreator public Part( @JsonProperty("id") Optional id, @JsonProperty("key") Optional key, @@ -91,45 +93,69 @@ public class Part { this.optimizedForStreaming = optimizedForStreaming; this.videoProfile = videoProfile; } - - public Optional id() { - return id; + + public Part() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional file() { - return file; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional file() { + return (Optional) file; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional has64bitOffsets() { - return has64bitOffsets; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional hasThumbnail() { - return hasThumbnail; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional has64bitOffsets() { + return (Optional) has64bitOffsets; } - public Optional optimizedForStreaming() { - return optimizedForStreaming; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasThumbnail() { + return (Optional) hasThumbnail; } - public Optional videoProfile() { - return videoProfile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional optimizedForStreaming() { + return (Optional) optimizedForStreaming; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoProfile() { + return (Optional) videoProfile; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PathParamFilter.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PathParamFilter.java new file mode 100644 index 00000000..8dced670 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PathParamFilter.java @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import lukehagar.plexapi.plexapi.utils.Utils; + +/** + * PathParamFilter - Filter + */ +public enum PathParamFilter { + ALL("all"), + AVAILABLE("available"), + RELEASED("released"); + + @JsonValue + private final String value; + + private PathParamFilter(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PathParamTaskName.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PathParamTaskName.java index 6f8c0b8f..1934aed9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PathParamTaskName.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PathParamTaskName.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchRequest.java index 0abfdd24..d7332bdf 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -15,7 +17,6 @@ import lukehagar.plexapi.plexapi.utils.LazySingletonValue; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class PerformSearchRequest { /** @@ -36,6 +37,7 @@ public class PerformSearchRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") private Optional limit; + @JsonCreator public PerformSearchRequest( String query, Optional sectionId, @@ -47,10 +49,16 @@ public class PerformSearchRequest { this.sectionId = sectionId; this.limit = limit; } + + public PerformSearchRequest( + String query) { + this(query, Optional.empty(), Optional.empty()); + } /** * The query term */ + @JsonIgnore public String query() { return query; } @@ -58,15 +66,19 @@ public class PerformSearchRequest { /** * This gives context to the search, and can result in re-ordering of search result hubs */ - public Optional sectionId() { - return sectionId; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sectionId() { + return (Optional) sectionId; } /** * The number of items to return per hub */ - public Optional limit() { - return limit; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchResponse.java index 60ea365d..69e1b79b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformSearchResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class PerformSearchResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class PerformSearchResponse implements lukehagar.plexapi.plexapi.utils.Re */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public PerformSearchResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class PerformSearchResponse implements lukehagar.plexapi.plexapi.utils.Re /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class PerformSearchResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class PerformSearchResponse implements lukehagar.plexapi.plexapi.utils.Re this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public PerformSearchResponse withObject(PerformSearchResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public PerformSearchResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class PerformSearchResponse implements lukehagar.plexapi.plexapi.utils.Re return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class PerformSearchResponse implements lukehagar.plexapi.plexapi.utils.Re return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class PerformSearchResponse implements lukehagar.plexapi.plexapi.utils.Re return Utils.toString(PerformSearchResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class PerformSearchResponse implements lukehagar.plexapi.plexapi.utils.Re private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class PerformSearchResponse implements lukehagar.plexapi.plexapi.utils.Re this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(PerformSearchResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public PerformSearchResponse build() { return new PerformSearchResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchRequest.java index b86689a9..5288a5e5 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -15,7 +17,6 @@ import lukehagar.plexapi.plexapi.utils.LazySingletonValue; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class PerformVoiceSearchRequest { /** @@ -36,6 +37,7 @@ public class PerformVoiceSearchRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") private Optional limit; + @JsonCreator public PerformVoiceSearchRequest( String query, Optional sectionId, @@ -47,10 +49,16 @@ public class PerformVoiceSearchRequest { this.sectionId = sectionId; this.limit = limit; } + + public PerformVoiceSearchRequest( + String query) { + this(query, Optional.empty(), Optional.empty()); + } /** * The query term */ + @JsonIgnore public String query() { return query; } @@ -58,15 +66,19 @@ public class PerformVoiceSearchRequest { /** * This gives context to the search, and can result in re-ordering of search result hubs */ - public Optional sectionId() { - return sectionId; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sectionId() { + return (Optional) sectionId; } /** * The number of items to return per hub */ - public Optional limit() { - return limit; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchResponse.java index 16ea2911..a66272b4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PerformVoiceSearchResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class PerformVoiceSearchResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class PerformVoiceSearchResponse implements lukehagar.plexapi.plexapi.uti */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public PerformVoiceSearchResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class PerformVoiceSearchResponse implements lukehagar.plexapi.plexapi.uti /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class PerformVoiceSearchResponse implements lukehagar.plexapi.plexapi.uti /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class PerformVoiceSearchResponse implements lukehagar.plexapi.plexapi.uti this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public PerformVoiceSearchResponse withObject(PerformVoiceSearchResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public PerformVoiceSearchResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class PerformVoiceSearchResponse implements lukehagar.plexapi.plexapi.uti return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class PerformVoiceSearchResponse implements lukehagar.plexapi.plexapi.uti return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class PerformVoiceSearchResponse implements lukehagar.plexapi.plexapi.uti return Utils.toString(PerformVoiceSearchResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class PerformVoiceSearchResponse implements lukehagar.plexapi.plexapi.uti private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class PerformVoiceSearchResponse implements lukehagar.plexapi.plexapi.uti this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(PerformVoiceSearchResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public PerformVoiceSearchResponse build() { return new PerformVoiceSearchResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Player.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Player.java index 4fc71669..3017b2fe 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Player.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Player.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Player { @JsonInclude(Include.NON_ABSENT) @@ -79,6 +80,7 @@ public class Player { @JsonProperty("userID") private Optional userID; + @JsonCreator public Player( @JsonProperty("address") Optional address, @JsonProperty("machineIdentifier") Optional machineIdentifier, @@ -126,65 +128,99 @@ public class Player { this.secure = secure; this.userID = userID; } - - public Optional address() { - return address; + + 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()); } - public Optional machineIdentifier() { - return machineIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional address() { + return (Optional) address; } - public Optional model() { - return model; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional machineIdentifier() { + return (Optional) machineIdentifier; } - public Optional platform() { - return platform; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional model() { + return (Optional) model; } - public Optional platformVersion() { - return platformVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platform() { + return (Optional) platform; } - public Optional product() { - return product; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platformVersion() { + return (Optional) platformVersion; } - public Optional profile() { - return profile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional product() { + return (Optional) product; } - public Optional remotePublicAddress() { - return remotePublicAddress; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional profile() { + return (Optional) profile; } - public Optional state() { - return state; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional remotePublicAddress() { + return (Optional) remotePublicAddress; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional state() { + return (Optional) state; } - public Optional version() { - return version; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional local() { - return local; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional version() { + return (Optional) version; } - public Optional relayed() { - return relayed; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional local() { + return (Optional) local; } - public Optional secure() { - return secure; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional relayed() { + return (Optional) relayed; } - public Optional userID() { - return userID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional secure() { + return (Optional) secure; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userID() { + return (Optional) userID; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PlaylistType.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PlaylistType.java index 6e863744..fdee5f5c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/PlaylistType.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/PlaylistType.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Producer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Producer.java index f3d819be..a934a760 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Producer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Producer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Producer { @JsonInclude(Include.NON_ABSENT) @@ -39,6 +40,7 @@ public class Producer { @JsonProperty("thumb") private Optional thumb; + @JsonCreator public Producer( @JsonProperty("id") Optional id, @JsonProperty("filter") Optional filter, @@ -56,25 +58,39 @@ public class Producer { this.tagKey = tagKey; this.thumb = thumb; } - - public Optional id() { - return id; + + public Producer() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional filter() { - return filter; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; } - public Optional tagKey() { - return tagKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tagKey() { + return (Optional) tagKey; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Provider.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Provider.java index 3e72bc33..57c223c0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Provider.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Provider.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Provider { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class Provider { @JsonProperty("type") private Optional type; + @JsonCreator public Provider( @JsonProperty("key") Optional key, @JsonProperty("title") Optional title, @@ -42,17 +44,27 @@ public class Provider { this.title = title; this.type = type; } - - public Optional key() { - return key; + + public Provider() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamOnlyTransient.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamOnlyTransient.java index 77a49dcb..f8eabcb4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamOnlyTransient.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamOnlyTransient.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamSmart.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamSmart.java index c482b690..42710996 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamSmart.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamSmart.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamType.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamType.java index 99c7c7f5..33e7d3d8 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamType.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/QueryParamType.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Ratings.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Ratings.java index 49a58f29..c66f43a5 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Ratings.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Ratings.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Ratings { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class Ratings { @JsonProperty("type") private Optional type; + @JsonCreator public Ratings( @JsonProperty("image") Optional image, @JsonProperty("value") Optional value, @@ -42,17 +44,27 @@ public class Ratings { this.value = value; this.type = type; } - - public Optional image() { - return image; + + public Ratings() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional value() { - return value; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional image() { + return (Optional) image; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional value() { + return (Optional) value; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryRequest.java index 88289ce8..ac96230d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class RefreshLibraryRequest { /** @@ -22,6 +23,7 @@ public class RefreshLibraryRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionId") private double sectionId; + @JsonCreator public RefreshLibraryRequest( double sectionId) { Utils.checkNotNull(sectionId, "sectionId"); @@ -31,6 +33,7 @@ public class RefreshLibraryRequest { /** * the Id of the library to refresh */ + @JsonIgnore public double sectionId() { return sectionId; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryResponse.java index e9f08d60..68c58056 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/RefreshLibraryResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class RefreshLibraryResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class RefreshLibraryResponse implements lukehagar.plexapi.plexapi.utils.R */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public RefreshLibraryResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class RefreshLibraryResponse implements lukehagar.plexapi.plexapi.utils.R /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class RefreshLibraryResponse implements lukehagar.plexapi.plexapi.utils.R /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class RefreshLibraryResponse implements lukehagar.plexapi.plexapi.utils.R this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public RefreshLibraryResponse withObject(RefreshLibraryResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public RefreshLibraryResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class RefreshLibraryResponse implements lukehagar.plexapi.plexapi.utils.R return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class RefreshLibraryResponse implements lukehagar.plexapi.plexapi.utils.R return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class RefreshLibraryResponse implements lukehagar.plexapi.plexapi.utils.R return Utils.toString(RefreshLibraryResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class RefreshLibraryResponse implements lukehagar.plexapi.plexapi.utils.R private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class RefreshLibraryResponse implements lukehagar.plexapi.plexapi.utils.R this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(RefreshLibraryResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public RefreshLibraryResponse build() { return new RefreshLibraryResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Release.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Release.java index 7aa44127..922c8fba 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Release.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Release.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Release { @JsonInclude(Include.NON_ABSENT) @@ -43,6 +44,7 @@ public class Release { @JsonProperty("state") private Optional state; + @JsonCreator public Release( @JsonProperty("key") Optional key, @JsonProperty("version") Optional version, @@ -63,29 +65,45 @@ public class Release { this.downloadURL = downloadURL; this.state = state; } - - public Optional key() { - return key; + + public Release() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional version() { - return version; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional added() { - return added; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional version() { + return (Optional) version; } - public Optional fixed() { - return fixed; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional added() { + return (Optional) added; } - public Optional downloadURL() { - return downloadURL; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional fixed() { + return (Optional) fixed; } - public Optional state() { - return state; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional downloadURL() { + return (Optional) downloadURL; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional state() { + return (Optional) state; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Role.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Role.java index ff1a42ac..5b80d2c6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Role.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Role.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Role { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public Role( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public Role() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SDKMethodInterfaces.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SDKMethodInterfaces.java index 966b8c5f..55007093 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SDKMethodInterfaces.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SDKMethodInterfaces.java @@ -125,6 +125,28 @@ public class SDKMethodInterfaces { } + public interface MethodCallGetHomeData { + lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponse getHomeDataDirect() throws Exception; + } + + + public interface MethodCallGetPin { + lukehagar.plexapi.plexapi.models.operations.GetPinResponse getPin( + Optional strong, + Optional xPlexClientIdentifier, + String xPlexProduct, + java.util.Optional serverURL) throws Exception; + } + + + public interface MethodCallGetToken { + lukehagar.plexapi.plexapi.models.operations.GetTokenResponse getToken( + String pinID, + Optional xPlexClientIdentifier, + java.util.Optional serverURL) throws Exception; + } + + public interface MethodCallGetGlobalHubs { lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse getGlobalHubs( Optional count, @@ -194,8 +216,9 @@ public class SDKMethodInterfaces { public interface MethodCallGetLibraryItems { lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponse getLibraryItems( - long sectionId, - lukehagar.plexapi.plexapi.models.operations.Tag tag) throws Exception; + java.lang.Object sectionId, + lukehagar.plexapi.plexapi.models.operations.Tag tag, + Optional includeGuids) throws Exception; } @@ -220,7 +243,15 @@ public class SDKMethodInterfaces { public interface MethodCallGetMetadataChildren { lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponse getMetadataChildren( - double ratingKey) throws Exception; + double ratingKey, + Optional includeElements) throws Exception; + } + + + public interface MethodCallGetTopWatchedContent { + lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentResponse getTopWatchedContent( + long type, + Optional includeGuids) throws Exception; } @@ -248,22 +279,6 @@ public class SDKMethodInterfaces { } - public interface MethodCallGetPin { - lukehagar.plexapi.plexapi.models.operations.GetPinResponse getPin( - Optional strong, - String xPlexClientIdentifier, - java.util.Optional serverURL) throws Exception; - } - - - public interface MethodCallGetToken { - lukehagar.plexapi.plexapi.models.operations.GetTokenResponse getToken( - String pinID, - String xPlexClientIdentifier, - java.util.Optional serverURL) throws Exception; - } - - public interface MethodCallCreatePlaylist { lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponse createPlaylist( lukehagar.plexapi.plexapi.models.operations.CreatePlaylistRequest request) throws Exception; @@ -344,13 +359,29 @@ public class SDKMethodInterfaces { } + public interface MethodCallGetResourcesStatistics { + lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse getResourcesStatistics( + Optional timespan) throws Exception; + } + + + public interface MethodCallGetBandwidthStatistics { + lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse getBandwidthStatistics( + Optional timespan) throws Exception; + } + + public interface MethodCallGetSessions { lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse getSessionsDirect() throws Exception; } public interface MethodCallGetSessionHistory { - lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse getSessionHistoryDirect() throws Exception; + lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse getSessionHistory( + Optional sort, + Optional accountId, + Optional filter, + Optional librarySectionID) throws Exception; } @@ -382,4 +413,11 @@ public class SDKMethodInterfaces { Optional skip) throws Exception; } + + public interface MethodCallGetWatchlist { + lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse getWatchlist( + lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequest request, + java.util.Optional serverURL) throws Exception; + } + } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Scope.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Scope.java index 1b11cf71..9fbdadb4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Scope.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Scope.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryMediaContainer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryMediaContainer.java index 19be3b2c..32c146b1 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryMediaContainer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryMediaContainer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class SearchLibraryMediaContainer { @JsonInclude(Include.NON_ABSENT) @@ -71,6 +72,7 @@ public class SearchLibraryMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + @JsonCreator public SearchLibraryMediaContainer( @JsonProperty("size") Optional size, @JsonProperty("allowSync") Optional allowSync, @@ -112,57 +114,87 @@ public class SearchLibraryMediaContainer { this.viewMode = viewMode; this.metadata = metadata; } - - public Optional size() { - return size; + + public SearchLibraryMediaContainer() { + 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()); } - public Optional allowSync() { - return allowSync; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSync() { + return (Optional) allowSync; } - public Optional identifier() { - return identifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional mediaTagPrefix() { - return mediaTagPrefix; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; } - public Optional mediaTagVersion() { - return mediaTagVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagPrefix() { + return (Optional) mediaTagPrefix; } - public Optional nocache() { - return nocache; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaTagVersion() { + return (Optional) mediaTagVersion; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional nocache() { + return (Optional) nocache; } - public Optional title1() { - return title1; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional title2() { - return title2; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title1() { + return (Optional) title1; } - public Optional viewGroup() { - return viewGroup; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title2() { + return (Optional) title2; } - public Optional viewMode() { - return viewMode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewGroup() { + return (Optional) viewGroup; } - public Optional> metadata() { - return metadata; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional viewMode() { + return (Optional) viewMode; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metadata() { + return (Optional>) metadata; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryMetadata.java index f1dfd8d2..9d746bd7 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryMetadata.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class SearchLibraryMetadata { @JsonInclude(Include.NON_ABSENT) @@ -99,6 +100,7 @@ public class SearchLibraryMetadata { @JsonProperty("updatedAt") private Optional updatedAt; + @JsonCreator public SearchLibraryMetadata( @JsonProperty("ratingKey") Optional ratingKey, @JsonProperty("key") Optional key, @@ -161,85 +163,129 @@ public class SearchLibraryMetadata { this.addedAt = addedAt; this.updatedAt = updatedAt; } - - public Optional ratingKey() { - return ratingKey; + + public SearchLibraryMetadata() { + 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()); } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ratingKey() { + return (Optional) ratingKey; } - public Optional parentRatingKey() { - return parentRatingKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional guid() { - return guid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentRatingKey() { + return (Optional) parentRatingKey; } - public Optional parentGuid() { - return parentGuid; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional guid() { + return (Optional) guid; } - public Optional parentStudio() { - return parentStudio; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentGuid() { + return (Optional) parentGuid; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentStudio() { + return (Optional) parentStudio; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional parentKey() { - return parentKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } - public Optional parentTitle() { - return parentTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentKey() { + return (Optional) parentKey; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentTitle() { + return (Optional) parentTitle; } - public Optional index() { - return index; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional parentIndex() { - return parentIndex; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional index() { + return (Optional) index; } - public Optional parentYear() { - return parentYear; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentIndex() { + return (Optional) parentIndex; } - public Optional thumb() { - return thumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentYear() { + return (Optional) parentYear; } - public Optional art() { - return art; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional thumb() { + return (Optional) thumb; } - public Optional parentThumb() { - return parentThumb; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional art() { + return (Optional) art; } - public Optional parentTheme() { - return parentTheme; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentThumb() { + return (Optional) parentThumb; } - public Optional addedAt() { - return addedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional parentTheme() { + return (Optional) parentTheme; } - public Optional updatedAt() { - return updatedAt; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addedAt() { + return (Optional) addedAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryRequest.java index c0bfba37..819538b8 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class SearchLibraryRequest { /** @@ -28,6 +29,7 @@ public class SearchLibraryRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=type") private Type type; + @JsonCreator public SearchLibraryRequest( long sectionId, Type type) { @@ -40,6 +42,7 @@ public class SearchLibraryRequest { /** * the Id of the library to query */ + @JsonIgnore public long sectionId() { return sectionId; } @@ -47,6 +50,7 @@ public class SearchLibraryRequest { /** * Plex content type to search for */ + @JsonIgnore public Type type() { return type; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryResponse.java index 4ad5e962..6ab2afd7 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryResponse.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.net.http.HttpResponse; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class SearchLibraryResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -37,6 +38,7 @@ public class SearchLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re */ private Optional object; + @JsonCreator public SearchLibraryResponse( String contentType, int statusCode, @@ -51,10 +53,18 @@ public class SearchLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re this.rawResponse = rawResponse; this.object = object; } + + public SearchLibraryResponse( + 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; } @@ -62,6 +72,7 @@ public class SearchLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,6 +80,7 @@ public class SearchLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } @@ -76,8 +88,10 @@ public class SearchLibraryResponse implements lukehagar.plexapi.plexapi.utils.Re /** * The contents of the library by section and type */ - public Optional object() { - return object; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryResponseBody.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryResponseBody.java index f20d03b0..93b684a4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryResponseBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/SearchLibraryResponseBody.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -15,7 +17,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - /** * SearchLibraryResponseBody - The contents of the library by section and type */ @@ -26,14 +27,21 @@ public class SearchLibraryResponseBody { @JsonProperty("MediaContainer") private Optional mediaContainer; + @JsonCreator public SearchLibraryResponseBody( @JsonProperty("MediaContainer") Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } + + public SearchLibraryResponseBody() { + this(Optional.empty()); + } - public Optional mediaContainer() { - return mediaContainer; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaContainer() { + return (Optional) mediaContainer; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Server.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Server.java index e8ed9029..979c779b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Server.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Server.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Server { @JsonInclude(Include.NON_ABSENT) @@ -63,6 +64,7 @@ public class Server { @JsonProperty("protocolCapabilities") private Optional protocolCapabilities; + @JsonCreator public Server( @JsonProperty("name") Optional name, @JsonProperty("host") Optional host, @@ -98,49 +100,75 @@ public class Server { this.protocolVersion = protocolVersion; this.protocolCapabilities = protocolCapabilities; } - - public Optional name() { - return name; + + 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()); } - public Optional host() { - return host; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; } - public Optional address() { - return address; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional host() { + return (Optional) host; } - public Optional port() { - return port; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional address() { + return (Optional) address; } - public Optional machineIdentifier() { - return machineIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional port() { + return (Optional) port; } - public Optional version() { - return version; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional machineIdentifier() { + return (Optional) machineIdentifier; } - public Optional protocol() { - return protocol; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional version() { + return (Optional) version; } - public Optional product() { - return product; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional protocol() { + return (Optional) protocol; } - public Optional deviceClass() { - return deviceClass; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional product() { + return (Optional) product; } - public Optional protocolVersion() { - return protocolVersion; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deviceClass() { + return (Optional) deviceClass; } - public Optional protocolCapabilities() { - return protocolCapabilities; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional protocolVersion() { + return (Optional) protocolVersion; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional protocolCapabilities() { + return (Optional) protocolCapabilities; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Session.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Session.java index b04f65e0..e4f828b6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Session.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Session.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Session { @JsonInclude(Include.NON_ABSENT) @@ -31,6 +32,7 @@ public class Session { @JsonProperty("location") private Optional location; + @JsonCreator public Session( @JsonProperty("id") Optional id, @JsonProperty("bandwidth") Optional bandwidth, @@ -42,17 +44,27 @@ public class Session { this.bandwidth = bandwidth; this.location = location; } - - public Optional id() { - return id; + + public Session() { + this(Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional bandwidth() { - return bandwidth; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional location() { - return location; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bandwidth() { + return (Optional) bandwidth; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional location() { + return (Optional) location; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Setting.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Setting.java index 002a3603..b71116f4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Setting.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Setting.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Setting { @JsonInclude(Include.NON_ABSENT) @@ -59,6 +60,7 @@ public class Setting { @JsonProperty("enumValues") private Optional enumValues; + @JsonCreator public Setting( @JsonProperty("id") Optional id, @JsonProperty("label") Optional label, @@ -91,45 +93,69 @@ public class Setting { this.group = group; this.enumValues = enumValues; } - - public Optional id() { - return id; + + public Setting() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional label() { - return label; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional label() { + return (Optional) label; } - public Optional type() { - return type; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } - public Optional default_() { - return default_; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional type() { + return (Optional) type; } - public Optional value() { - return value; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional default_() { + return (Optional) default_; } - public Optional hidden() { - return hidden; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional value() { + return (Optional) value; } - public Optional advanced() { - return advanced; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hidden() { + return (Optional) hidden; } - public Optional group() { - return group; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional advanced() { + return (Optional) advanced; } - public Optional enumValues() { - return enumValues; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional group() { + return (Optional) group; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional enumValues() { + return (Optional) enumValues; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Skip.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Skip.java index d871b46a..0be98c01 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Skip.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Skip.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Smart.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Smart.java index 83fd3851..49a9ae18 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Smart.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Smart.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Sort.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Sort.java index 5646e794..c157fc15 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Sort.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Sort.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Sort { @JsonInclude(Include.NON_ABSENT) @@ -43,6 +44,7 @@ public class Sort { @JsonProperty("title") private Optional title; + @JsonCreator public Sort( @JsonProperty("default") Optional default_, @JsonProperty("defaultDirection") Optional defaultDirection, @@ -63,29 +65,45 @@ public class Sort { this.key = key; this.title = title; } - - public Optional default_() { - return default_; + + public Sort() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional defaultDirection() { - return defaultDirection; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional default_() { + return (Optional) default_; } - public Optional descKey() { - return descKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional defaultDirection() { + return (Optional) defaultDirection; } - public Optional firstCharacterKey() { - return firstCharacterKey; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional descKey() { + return (Optional) descKey; } - public Optional key() { - return key; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional firstCharacterKey() { + return (Optional) firstCharacterKey; } - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksResponse.java index c6459315..60af603d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartAllTasksResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StartAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class StartAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Re */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public StartAllTasksResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class StartAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Re /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class StartAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Re /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class StartAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Re this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StartAllTasksResponse withObject(StartAllTasksResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StartAllTasksResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class StartAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Re return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class StartAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Re return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class StartAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Re return Utils.toString(StartAllTasksResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class StartAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Re private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class StartAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Re this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(StartAllTasksResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public StartAllTasksResponse build() { return new StartAllTasksResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskRequest.java index bcd08a42..0e43e7f6 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class StartTaskRequest { /** @@ -22,6 +23,7 @@ public class StartTaskRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=taskName") private TaskName taskName; + @JsonCreator public StartTaskRequest( TaskName taskName) { Utils.checkNotNull(taskName, "taskName"); @@ -31,6 +33,7 @@ public class StartTaskRequest { /** * the name of the task to be started. */ + @JsonIgnore public TaskName taskName() { return taskName; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskResponse.java index 06b653ca..deaaefea 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartTaskResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StartTaskResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class StartTaskResponse implements lukehagar.plexapi.plexapi.utils.Respon */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public StartTaskResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class StartTaskResponse implements lukehagar.plexapi.plexapi.utils.Respon /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class StartTaskResponse implements lukehagar.plexapi.plexapi.utils.Respon /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class StartTaskResponse implements lukehagar.plexapi.plexapi.utils.Respon this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StartTaskResponse withObject(StartTaskResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StartTaskResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class StartTaskResponse implements lukehagar.plexapi.plexapi.utils.Respon return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class StartTaskResponse implements lukehagar.plexapi.plexapi.utils.Respon return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class StartTaskResponse implements lukehagar.plexapi.plexapi.utils.Respon return Utils.toString(StartTaskResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class StartTaskResponse implements lukehagar.plexapi.plexapi.utils.Respon private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class StartTaskResponse implements lukehagar.plexapi.plexapi.utils.Respon this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(StartTaskResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public StartTaskResponse build() { return new StartTaskResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeRequest.java index 09d7df7c..5eaa0060 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class StartUniversalTranscodeRequest { /** @@ -113,6 +114,7 @@ public class StartUniversalTranscodeRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=autoAdjustQuality") private Optional autoAdjustQuality; + @JsonCreator public StartUniversalTranscodeRequest( double hasMDE, String path, @@ -163,10 +165,20 @@ public class StartUniversalTranscodeRequest { this.addDebugOverlay = addDebugOverlay; this.autoAdjustQuality = autoAdjustQuality; } + + public StartUniversalTranscodeRequest( + double hasMDE, + String path, + 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()); + } /** * Whether the media item has MDE */ + @JsonIgnore public double hasMDE() { return hasMDE; } @@ -174,6 +186,7 @@ public class StartUniversalTranscodeRequest { /** * The path to the media item to transcode */ + @JsonIgnore public String path() { return path; } @@ -181,6 +194,7 @@ public class StartUniversalTranscodeRequest { /** * The index of the media item to transcode */ + @JsonIgnore public double mediaIndex() { return mediaIndex; } @@ -188,6 +202,7 @@ public class StartUniversalTranscodeRequest { /** * The index of the part to transcode */ + @JsonIgnore public double partIndex() { return partIndex; } @@ -195,6 +210,7 @@ public class StartUniversalTranscodeRequest { /** * The protocol to use for the transcode session */ + @JsonIgnore public String protocol() { return protocol; } @@ -202,78 +218,100 @@ public class StartUniversalTranscodeRequest { /** * Whether to use fast seek or not */ - public Optional fastSeek() { - return fastSeek; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional fastSeek() { + return (Optional) fastSeek; } /** * Whether to use direct play or not */ - public Optional directPlay() { - return directPlay; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional directPlay() { + return (Optional) directPlay; } /** * Whether to use direct stream or not */ - public Optional directStream() { - return directStream; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional directStream() { + return (Optional) directStream; } /** * The size of the subtitles */ - public Optional subtitleSize() { - return subtitleSize; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subtitleSize() { + return (Optional) subtitleSize; } /** * The subtitles */ - public Optional subtites() { - return subtites; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subtites() { + return (Optional) subtites; } /** * The audio boost */ - public Optional audioBoost() { - return audioBoost; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioBoost() { + return (Optional) audioBoost; } /** * The location of the transcode session */ - public Optional location() { - return location; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional location() { + return (Optional) location; } /** * The size of the media buffer */ - public Optional mediaBufferSize() { - return mediaBufferSize; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional mediaBufferSize() { + return (Optional) mediaBufferSize; } /** * The session ID */ - public Optional session() { - return session; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional session() { + return (Optional) session; } /** * Whether to add a debug overlay or not */ - public Optional addDebugOverlay() { - return addDebugOverlay; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional addDebugOverlay() { + return (Optional) addDebugOverlay; } /** * Whether to auto adjust quality or not */ - public Optional autoAdjustQuality() { - return autoAdjustQuality; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional autoAdjustQuality() { + return (Optional) autoAdjustQuality; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeResponse.java index af4ff8a5..e75bf7c5 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StartUniversalTranscodeResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StartUniversalTranscodeResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class StartUniversalTranscodeResponse implements lukehagar.plexapi.plexap */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public StartUniversalTranscodeResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class StartUniversalTranscodeResponse implements lukehagar.plexapi.plexap /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class StartUniversalTranscodeResponse implements lukehagar.plexapi.plexap /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class StartUniversalTranscodeResponse implements lukehagar.plexapi.plexap this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StartUniversalTranscodeResponse withObject(StartUniversalTranscodeResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StartUniversalTranscodeResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class StartUniversalTranscodeResponse implements lukehagar.plexapi.plexap return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class StartUniversalTranscodeResponse implements lukehagar.plexapi.plexap return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class StartUniversalTranscodeResponse implements lukehagar.plexapi.plexap return Utils.toString(StartUniversalTranscodeResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class StartUniversalTranscodeResponse implements lukehagar.plexapi.plexap private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class StartUniversalTranscodeResponse implements lukehagar.plexapi.plexap this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(StartUniversalTranscodeResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public StartUniversalTranscodeResponse build() { return new StartUniversalTranscodeResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/State.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/State.java index f5dc0e14..488506bc 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/State.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/State.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsBandwidth.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsBandwidth.java new file mode 100644 index 00000000..00c6a969 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsBandwidth.java @@ -0,0 +1,326 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public StatisticsBandwidth( + @JsonProperty("accountID") Optional accountID, + @JsonProperty("deviceID") Optional deviceID, + @JsonProperty("timespan") Optional timespan, + @JsonProperty("at") Optional at, + @JsonProperty("lan") Optional lan, + @JsonProperty("bytes") Optional bytes) { + Utils.checkNotNull(accountID, "accountID"); + Utils.checkNotNull(deviceID, "deviceID"); + Utils.checkNotNull(timespan, "timespan"); + Utils.checkNotNull(at, "at"); + Utils.checkNotNull(lan, "lan"); + Utils.checkNotNull(bytes, "bytes"); + this.accountID = accountID; + this.deviceID = deviceID; + this.timespan = timespan; + this.at = at; + this.lan = lan; + this.bytes = bytes; + } + + public StatisticsBandwidth() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional accountID() { + return (Optional) accountID; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deviceID() { + return (Optional) deviceID; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional timespan() { + return (Optional) timespan; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional at() { + return (Optional) at; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lan() { + return (Optional) lan; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bytes() { + return (Optional) bytes; + } + + public final static Builder builder() { + return new Builder(); + } + + public StatisticsBandwidth withAccountID(int accountID) { + Utils.checkNotNull(accountID, "accountID"); + this.accountID = Optional.ofNullable(accountID); + return this; + } + + public StatisticsBandwidth withAccountID(Optional accountID) { + Utils.checkNotNull(accountID, "accountID"); + this.accountID = accountID; + return this; + } + + public StatisticsBandwidth withDeviceID(int deviceID) { + Utils.checkNotNull(deviceID, "deviceID"); + this.deviceID = Optional.ofNullable(deviceID); + return this; + } + + public StatisticsBandwidth withDeviceID(Optional deviceID) { + Utils.checkNotNull(deviceID, "deviceID"); + this.deviceID = deviceID; + return this; + } + + public StatisticsBandwidth withTimespan(long timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = Optional.ofNullable(timespan); + return this; + } + + public StatisticsBandwidth withTimespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + public StatisticsBandwidth withAt(int at) { + Utils.checkNotNull(at, "at"); + this.at = Optional.ofNullable(at); + return this; + } + + public StatisticsBandwidth withAt(Optional at) { + Utils.checkNotNull(at, "at"); + this.at = at; + return this; + } + + public StatisticsBandwidth withLan(boolean lan) { + Utils.checkNotNull(lan, "lan"); + this.lan = Optional.ofNullable(lan); + return this; + } + + public StatisticsBandwidth withLan(Optional lan) { + Utils.checkNotNull(lan, "lan"); + this.lan = lan; + return this; + } + + public StatisticsBandwidth withBytes(long bytes) { + Utils.checkNotNull(bytes, "bytes"); + this.bytes = Optional.ofNullable(bytes); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StatisticsBandwidth other = (StatisticsBandwidth) o; + return + java.util.Objects.deepEquals(this.accountID, other.accountID) && + java.util.Objects.deepEquals(this.deviceID, other.deviceID) && + java.util.Objects.deepEquals(this.timespan, other.timespan) && + java.util.Objects.deepEquals(this.at, other.at) && + java.util.Objects.deepEquals(this.lan, other.lan) && + java.util.Objects.deepEquals(this.bytes, other.bytes); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountID, + deviceID, + timespan, + at, + lan, + bytes); + } + + @Override + public String toString() { + return Utils.toString(StatisticsBandwidth.class, + "accountID", accountID, + "deviceID", deviceID, + "timespan", timespan, + "at", at, + "lan", lan, + "bytes", bytes); + } + + 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); + return this; + } + + public Builder accountID(Optional accountID) { + Utils.checkNotNull(accountID, "accountID"); + this.accountID = accountID; + return this; + } + + public Builder deviceID(int deviceID) { + Utils.checkNotNull(deviceID, "deviceID"); + this.deviceID = Optional.ofNullable(deviceID); + return this; + } + + public Builder deviceID(Optional deviceID) { + Utils.checkNotNull(deviceID, "deviceID"); + this.deviceID = deviceID; + return this; + } + + public Builder timespan(long timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = Optional.ofNullable(timespan); + return this; + } + + public Builder timespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + public Builder at(int at) { + Utils.checkNotNull(at, "at"); + this.at = Optional.ofNullable(at); + return this; + } + + public Builder at(Optional at) { + Utils.checkNotNull(at, "at"); + this.at = at; + return this; + } + + public Builder lan(boolean lan) { + Utils.checkNotNull(lan, "lan"); + this.lan = Optional.ofNullable(lan); + return this; + } + + public Builder lan(Optional lan) { + Utils.checkNotNull(lan, "lan"); + this.lan = lan; + return this; + } + + public Builder bytes(long bytes) { + Utils.checkNotNull(bytes, "bytes"); + this.bytes = Optional.ofNullable(bytes); + return this; + } + + public Builder bytes(Optional bytes) { + Utils.checkNotNull(bytes, "bytes"); + this.bytes = bytes; + return this; + } + + public StatisticsBandwidth build() { + return new StatisticsBandwidth( + accountID, + deviceID, + timespan, + at, + lan, + bytes); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsMedia.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsMedia.java index 8bd739b2..46961bd7 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsMedia.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsMedia.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StatisticsMedia { @JsonInclude(Include.NON_ABSENT) @@ -47,6 +48,7 @@ public class StatisticsMedia { @JsonProperty("duration") private Optional duration; + @JsonCreator public StatisticsMedia( @JsonProperty("accountID") Optional accountID, @JsonProperty("deviceID") Optional deviceID, @@ -70,33 +72,51 @@ public class StatisticsMedia { this.count = count; this.duration = duration; } - - public Optional accountID() { - return accountID; + + public StatisticsMedia() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } - public Optional deviceID() { - return deviceID; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional accountID() { + return (Optional) accountID; } - public Optional timespan() { - return timespan; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deviceID() { + return (Optional) deviceID; } - public Optional at() { - return at; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional timespan() { + return (Optional) timespan; } - public Optional metadataType() { - return metadataType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional at() { + return (Optional) at; } - public Optional count() { - return count; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional metadataType() { + return (Optional) metadataType; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional count() { + return (Optional) count; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsResources.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsResources.java new file mode 100644 index 00000000..9c0a015f --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StatisticsResources.java @@ -0,0 +1,326 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import lukehagar.plexapi.plexapi.utils.Utils; + +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; + + @JsonCreator + public StatisticsResources( + @JsonProperty("timespan") Optional timespan, + @JsonProperty("at") Optional at, + @JsonProperty("hostCpuUtilization") Optional hostCpuUtilization, + @JsonProperty("processCpuUtilization") Optional processCpuUtilization, + @JsonProperty("hostMemoryUtilization") Optional hostMemoryUtilization, + @JsonProperty("processMemoryUtilization") Optional processMemoryUtilization) { + Utils.checkNotNull(timespan, "timespan"); + Utils.checkNotNull(at, "at"); + Utils.checkNotNull(hostCpuUtilization, "hostCpuUtilization"); + Utils.checkNotNull(processCpuUtilization, "processCpuUtilization"); + Utils.checkNotNull(hostMemoryUtilization, "hostMemoryUtilization"); + Utils.checkNotNull(processMemoryUtilization, "processMemoryUtilization"); + this.timespan = timespan; + this.at = at; + this.hostCpuUtilization = hostCpuUtilization; + this.processCpuUtilization = processCpuUtilization; + this.hostMemoryUtilization = hostMemoryUtilization; + this.processMemoryUtilization = processMemoryUtilization; + } + + public StatisticsResources() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional timespan() { + return (Optional) timespan; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional at() { + return (Optional) at; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hostCpuUtilization() { + return (Optional) hostCpuUtilization; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional processCpuUtilization() { + return (Optional) processCpuUtilization; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hostMemoryUtilization() { + return (Optional) hostMemoryUtilization; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional processMemoryUtilization() { + return (Optional) processMemoryUtilization; + } + + public final static Builder builder() { + return new Builder(); + } + + public StatisticsResources withTimespan(long timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = Optional.ofNullable(timespan); + return this; + } + + public StatisticsResources withTimespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + public StatisticsResources withAt(long at) { + Utils.checkNotNull(at, "at"); + this.at = Optional.ofNullable(at); + return this; + } + + public StatisticsResources withAt(Optional at) { + Utils.checkNotNull(at, "at"); + this.at = at; + return this; + } + + public StatisticsResources withHostCpuUtilization(float hostCpuUtilization) { + Utils.checkNotNull(hostCpuUtilization, "hostCpuUtilization"); + this.hostCpuUtilization = Optional.ofNullable(hostCpuUtilization); + return this; + } + + public StatisticsResources withHostCpuUtilization(Optional hostCpuUtilization) { + Utils.checkNotNull(hostCpuUtilization, "hostCpuUtilization"); + this.hostCpuUtilization = hostCpuUtilization; + return this; + } + + public StatisticsResources withProcessCpuUtilization(float processCpuUtilization) { + Utils.checkNotNull(processCpuUtilization, "processCpuUtilization"); + this.processCpuUtilization = Optional.ofNullable(processCpuUtilization); + return this; + } + + public StatisticsResources withProcessCpuUtilization(Optional processCpuUtilization) { + Utils.checkNotNull(processCpuUtilization, "processCpuUtilization"); + this.processCpuUtilization = processCpuUtilization; + return this; + } + + public StatisticsResources withHostMemoryUtilization(float hostMemoryUtilization) { + Utils.checkNotNull(hostMemoryUtilization, "hostMemoryUtilization"); + this.hostMemoryUtilization = Optional.ofNullable(hostMemoryUtilization); + return this; + } + + public StatisticsResources withHostMemoryUtilization(Optional hostMemoryUtilization) { + Utils.checkNotNull(hostMemoryUtilization, "hostMemoryUtilization"); + this.hostMemoryUtilization = hostMemoryUtilization; + return this; + } + + public StatisticsResources withProcessMemoryUtilization(float processMemoryUtilization) { + Utils.checkNotNull(processMemoryUtilization, "processMemoryUtilization"); + this.processMemoryUtilization = Optional.ofNullable(processMemoryUtilization); + 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) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StatisticsResources other = (StatisticsResources) o; + return + java.util.Objects.deepEquals(this.timespan, other.timespan) && + java.util.Objects.deepEquals(this.at, other.at) && + java.util.Objects.deepEquals(this.hostCpuUtilization, other.hostCpuUtilization) && + java.util.Objects.deepEquals(this.processCpuUtilization, other.processCpuUtilization) && + java.util.Objects.deepEquals(this.hostMemoryUtilization, other.hostMemoryUtilization) && + java.util.Objects.deepEquals(this.processMemoryUtilization, other.processMemoryUtilization); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + timespan, + at, + hostCpuUtilization, + processCpuUtilization, + hostMemoryUtilization, + processMemoryUtilization); + } + + @Override + public String toString() { + return Utils.toString(StatisticsResources.class, + "timespan", timespan, + "at", at, + "hostCpuUtilization", hostCpuUtilization, + "processCpuUtilization", processCpuUtilization, + "hostMemoryUtilization", hostMemoryUtilization, + "processMemoryUtilization", processMemoryUtilization); + } + + 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); + return this; + } + + public Builder timespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + public Builder at(long at) { + Utils.checkNotNull(at, "at"); + this.at = Optional.ofNullable(at); + return this; + } + + public Builder at(Optional at) { + Utils.checkNotNull(at, "at"); + this.at = at; + return this; + } + + public Builder hostCpuUtilization(float hostCpuUtilization) { + Utils.checkNotNull(hostCpuUtilization, "hostCpuUtilization"); + this.hostCpuUtilization = Optional.ofNullable(hostCpuUtilization); + return this; + } + + public Builder hostCpuUtilization(Optional hostCpuUtilization) { + Utils.checkNotNull(hostCpuUtilization, "hostCpuUtilization"); + this.hostCpuUtilization = hostCpuUtilization; + return this; + } + + public Builder processCpuUtilization(float processCpuUtilization) { + Utils.checkNotNull(processCpuUtilization, "processCpuUtilization"); + this.processCpuUtilization = Optional.ofNullable(processCpuUtilization); + return this; + } + + public Builder processCpuUtilization(Optional processCpuUtilization) { + Utils.checkNotNull(processCpuUtilization, "processCpuUtilization"); + this.processCpuUtilization = processCpuUtilization; + return this; + } + + public Builder hostMemoryUtilization(float hostMemoryUtilization) { + Utils.checkNotNull(hostMemoryUtilization, "hostMemoryUtilization"); + this.hostMemoryUtilization = Optional.ofNullable(hostMemoryUtilization); + return this; + } + + public Builder hostMemoryUtilization(Optional hostMemoryUtilization) { + Utils.checkNotNull(hostMemoryUtilization, "hostMemoryUtilization"); + this.hostMemoryUtilization = hostMemoryUtilization; + return this; + } + + public Builder processMemoryUtilization(float processMemoryUtilization) { + Utils.checkNotNull(processMemoryUtilization, "processMemoryUtilization"); + this.processMemoryUtilization = Optional.ofNullable(processMemoryUtilization); + return this; + } + + public Builder processMemoryUtilization(Optional processMemoryUtilization) { + Utils.checkNotNull(processMemoryUtilization, "processMemoryUtilization"); + this.processMemoryUtilization = processMemoryUtilization; + return this; + } + + public StatisticsResources build() { + return new StatisticsResources( + timespan, + at, + hostCpuUtilization, + processCpuUtilization, + hostMemoryUtilization, + processMemoryUtilization); + } + } +} + diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksResponse.java index 79d671dc..d0c0a32c 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopAllTasksResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StopAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class StopAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Res */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public StopAllTasksResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class StopAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Res /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class StopAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Res /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class StopAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Res this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StopAllTasksResponse withObject(StopAllTasksResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StopAllTasksResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class StopAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Res return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class StopAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Res return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class StopAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Res return Utils.toString(StopAllTasksResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class StopAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Res private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class StopAllTasksResponse implements lukehagar.plexapi.plexapi.utils.Res this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(StopAllTasksResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public StopAllTasksResponse build() { return new StopAllTasksResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskRequest.java index 5ad81cc5..db0e9b44 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class StopTaskRequest { /** @@ -22,6 +23,7 @@ public class StopTaskRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=taskName") private PathParamTaskName taskName; + @JsonCreator public StopTaskRequest( PathParamTaskName taskName) { Utils.checkNotNull(taskName, "taskName"); @@ -31,6 +33,7 @@ public class StopTaskRequest { /** * The name of the task to be started. */ + @JsonIgnore public PathParamTaskName taskName() { return taskName; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskResponse.java index 83011b79..67727705 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTaskResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StopTaskResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class StopTaskResponse implements lukehagar.plexapi.plexapi.utils.Respons */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public StopTaskResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class StopTaskResponse implements lukehagar.plexapi.plexapi.utils.Respons /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class StopTaskResponse implements lukehagar.plexapi.plexapi.utils.Respons /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class StopTaskResponse implements lukehagar.plexapi.plexapi.utils.Respons this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StopTaskResponse withObject(StopTaskResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StopTaskResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class StopTaskResponse implements lukehagar.plexapi.plexapi.utils.Respons return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class StopTaskResponse implements lukehagar.plexapi.plexapi.utils.Respons return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class StopTaskResponse implements lukehagar.plexapi.plexapi.utils.Respons return Utils.toString(StopTaskResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class StopTaskResponse implements lukehagar.plexapi.plexapi.utils.Respons private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class StopTaskResponse implements lukehagar.plexapi.plexapi.utils.Respons this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(StopTaskResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public StopTaskResponse build() { return new StopTaskResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionRequest.java index dfc6f9d2..91c111ad 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class StopTranscodeSessionRequest { /** @@ -22,6 +23,7 @@ public class StopTranscodeSessionRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sessionKey") private String sessionKey; + @JsonCreator public StopTranscodeSessionRequest( String sessionKey) { Utils.checkNotNull(sessionKey, "sessionKey"); @@ -31,6 +33,7 @@ public class StopTranscodeSessionRequest { /** * the Key of the transcode session to stop */ + @JsonIgnore public String sessionKey() { return sessionKey; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionResponse.java index c00ad4e8..fe8bf984 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/StopTranscodeSessionResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class StopTranscodeSessionResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class StopTranscodeSessionResponse implements lukehagar.plexapi.plexapi.u */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public StopTranscodeSessionResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class StopTranscodeSessionResponse implements lukehagar.plexapi.plexapi.u /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class StopTranscodeSessionResponse implements lukehagar.plexapi.plexapi.u /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class StopTranscodeSessionResponse implements lukehagar.plexapi.plexapi.u this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StopTranscodeSessionResponse withObject(StopTranscodeSessionResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public StopTranscodeSessionResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class StopTranscodeSessionResponse implements lukehagar.plexapi.plexapi.u return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class StopTranscodeSessionResponse implements lukehagar.plexapi.plexapi.u return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class StopTranscodeSessionResponse implements lukehagar.plexapi.plexapi.u return Utils.toString(StopTranscodeSessionResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class StopTranscodeSessionResponse implements lukehagar.plexapi.plexapi.u private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class StopTranscodeSessionResponse implements lukehagar.plexapi.plexapi.u this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(StopTranscodeSessionResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public StopTranscodeSessionResponse build() { return new StopTranscodeSessionResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Stream.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Stream.java index 5bdeefae..6b470728 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Stream.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Stream.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Stream { @JsonInclude(Include.NON_ABSENT) @@ -147,6 +148,7 @@ public class Stream { @JsonProperty("samplingRate") private Optional samplingRate; + @JsonCreator public Stream( @JsonProperty("id") Optional id, @JsonProperty("streamType") Optional streamType, @@ -245,133 +247,201 @@ public class Stream { this.languageCode = languageCode; this.samplingRate = samplingRate; } - - public Optional id() { - return id; + + public Stream() { + 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()); } - public Optional streamType() { - return streamType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } - public Optional default_() { - return default_; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional streamType() { + return (Optional) streamType; } - public Optional codec() { - return codec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional default_() { + return (Optional) default_; } - public Optional index() { - return index; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional codec() { + return (Optional) codec; } - public Optional bitrate() { - return bitrate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional index() { + return (Optional) index; } - public Optional bitDepth() { - return bitDepth; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitrate() { + return (Optional) bitrate; } - public Optional chromaLocation() { - return chromaLocation; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional bitDepth() { + return (Optional) bitDepth; } - public Optional chromaSubsampling() { - return chromaSubsampling; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional chromaLocation() { + return (Optional) chromaLocation; } - public Optional codedHeight() { - return codedHeight; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional chromaSubsampling() { + return (Optional) chromaSubsampling; } - public Optional codedWidth() { - return codedWidth; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional codedHeight() { + return (Optional) codedHeight; } - public Optional colorPrimaries() { - return colorPrimaries; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional codedWidth() { + return (Optional) codedWidth; } - public Optional colorRange() { - return colorRange; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional colorPrimaries() { + return (Optional) colorPrimaries; } - public Optional colorSpace() { - return colorSpace; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional colorRange() { + return (Optional) colorRange; } - public Optional colorTrc() { - return colorTrc; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional colorSpace() { + return (Optional) colorSpace; } - public Optional frameRate() { - return frameRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional colorTrc() { + return (Optional) colorTrc; } - public Optional hasScalingMatrix() { - return hasScalingMatrix; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional frameRate() { + return (Optional) frameRate; } - public Optional height() { - return height; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasScalingMatrix() { + return (Optional) hasScalingMatrix; } - public Optional level() { - return level; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional height() { + return (Optional) height; } - public Optional profile() { - return profile; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional level() { + return (Optional) level; } - public Optional refFrames() { - return refFrames; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional profile() { + return (Optional) profile; } - public Optional scanType() { - return scanType; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional refFrames() { + return (Optional) refFrames; } - public Optional streamIdentifier() { - return streamIdentifier; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional scanType() { + return (Optional) scanType; } - public Optional width() { - return width; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional streamIdentifier() { + return (Optional) streamIdentifier; } - public Optional displayTitle() { - return displayTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional width() { + return (Optional) width; } - public Optional extendedDisplayTitle() { - return extendedDisplayTitle; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional displayTitle() { + return (Optional) displayTitle; } - public Optional selected() { - return selected; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional extendedDisplayTitle() { + return (Optional) extendedDisplayTitle; } - public Optional channels() { - return channels; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional selected() { + return (Optional) selected; } - public Optional language() { - return language; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional channels() { + return (Optional) channels; } - public Optional languageTag() { - return languageTag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional language() { + return (Optional) language; } - public Optional languageCode() { - return languageCode; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional languageTag() { + return (Optional) languageTag; } - public Optional samplingRate() { - return samplingRate; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional languageCode() { + return (Optional) languageCode; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional samplingRate() { + return (Optional) samplingRate; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Tag.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Tag.java index ed1af032..a5d2f11b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Tag.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Tag.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/TaskName.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/TaskName.java index a54cdf1f..9327c577 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/TaskName.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/TaskName.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Tonight.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Tonight.java index 60823a83..fb21b3a9 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Tonight.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Tonight.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/TranscodeSession.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/TranscodeSession.java index e510c03f..75a32b2b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/TranscodeSession.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/TranscodeSession.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,7 +18,6 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class TranscodeSession { @JsonInclude(Include.NON_ABSENT) @@ -115,6 +116,7 @@ public class TranscodeSession { @JsonProperty("minOffsetAvailable") private Optional minOffsetAvailable; + @JsonCreator public TranscodeSession( @JsonProperty("key") Optional key, @JsonProperty("throttled") Optional throttled, @@ -189,101 +191,153 @@ public class TranscodeSession { this.maxOffsetAvailable = maxOffsetAvailable; this.minOffsetAvailable = minOffsetAvailable; } - - public Optional key() { - return key; + + 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()); } - public Optional throttled() { - return throttled; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional key() { + return (Optional) key; } - public Optional complete() { - return complete; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional throttled() { + return (Optional) throttled; } - public Optional progress() { - return progress; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional complete() { + return (Optional) complete; } - public Optional size() { - return size; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional progress() { + return (Optional) progress; } - public Optional speed() { - return speed; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional size() { + return (Optional) size; } - public Optional error() { - return error; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional speed() { + return (Optional) speed; } - public Optional duration() { - return duration; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional error() { + return (Optional) error; } - public Optional remaining() { - return remaining; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional duration() { + return (Optional) duration; } - public Optional context() { - return context; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional remaining() { + return (Optional) remaining; } - public Optional sourceVideoCodec() { - return sourceVideoCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional context() { + return (Optional) context; } - public Optional sourceAudioCodec() { - return sourceAudioCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sourceVideoCodec() { + return (Optional) sourceVideoCodec; } - public Optional videoDecision() { - return videoDecision; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sourceAudioCodec() { + return (Optional) sourceAudioCodec; } - public Optional audioDecision() { - return audioDecision; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoDecision() { + return (Optional) videoDecision; } - public Optional subtitleDecision() { - return subtitleDecision; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioDecision() { + return (Optional) audioDecision; } - public Optional protocol() { - return protocol; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional subtitleDecision() { + return (Optional) subtitleDecision; } - public Optional container() { - return container; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional protocol() { + return (Optional) protocol; } - public Optional videoCodec() { - return videoCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional container() { + return (Optional) container; } - public Optional audioCodec() { - return audioCodec; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional videoCodec() { + return (Optional) videoCodec; } - public Optional audioChannels() { - return audioChannels; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioCodec() { + return (Optional) audioCodec; } - public Optional transcodeHwRequested() { - return transcodeHwRequested; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional audioChannels() { + return (Optional) audioChannels; } - public Optional timeStamp() { - return timeStamp; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional transcodeHwRequested() { + return (Optional) transcodeHwRequested; } - public Optional maxOffsetAvailable() { - return maxOffsetAvailable; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional timeStamp() { + return (Optional) timeStamp; } - public Optional minOffsetAvailable() { - return minOffsetAvailable; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional maxOffsetAvailable() { + return (Optional) maxOffsetAvailable; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional minOffsetAvailable() { + return (Optional) minOffsetAvailable; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Type.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Type.java index b99db6ec..af809a6b 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Type.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Type.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressRequest.java index c0738f27..f77c21ab 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class UpdatePlayProgressRequest { /** @@ -34,6 +35,7 @@ public class UpdatePlayProgressRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=state") private String state; + @JsonCreator public UpdatePlayProgressRequest( String key, double time, @@ -49,6 +51,7 @@ public class UpdatePlayProgressRequest { /** * the media key */ + @JsonIgnore public String key() { return key; } @@ -56,6 +59,7 @@ public class UpdatePlayProgressRequest { /** * The time, in milliseconds, used to set the media playback progress. */ + @JsonIgnore public double time() { return time; } @@ -63,6 +67,7 @@ public class UpdatePlayProgressRequest { /** * The playback state of the media item. */ + @JsonIgnore public String state() { return state; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressResponse.java index e9c8fea9..4ed7815a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlayProgressResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class UpdatePlayProgressResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class UpdatePlayProgressResponse implements lukehagar.plexapi.plexapi.uti */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public UpdatePlayProgressResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class UpdatePlayProgressResponse implements lukehagar.plexapi.plexapi.uti /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class UpdatePlayProgressResponse implements lukehagar.plexapi.plexapi.uti /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class UpdatePlayProgressResponse implements lukehagar.plexapi.plexapi.uti this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public UpdatePlayProgressResponse withObject(UpdatePlayProgressResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public UpdatePlayProgressResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class UpdatePlayProgressResponse implements lukehagar.plexapi.plexapi.uti return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class UpdatePlayProgressResponse implements lukehagar.plexapi.plexapi.uti return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class UpdatePlayProgressResponse implements lukehagar.plexapi.plexapi.uti return Utils.toString(UpdatePlayProgressResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class UpdatePlayProgressResponse implements lukehagar.plexapi.plexapi.uti private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class UpdatePlayProgressResponse implements lukehagar.plexapi.plexapi.uti this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(UpdatePlayProgressResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public UpdatePlayProgressResponse build() { return new UpdatePlayProgressResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistRequest.java index de18d6aa..020e157d 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -14,7 +16,6 @@ import java.util.Optional; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class UpdatePlaylistRequest { /** @@ -35,6 +36,7 @@ public class UpdatePlaylistRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=summary") private Optional summary; + @JsonCreator public UpdatePlaylistRequest( double playlistID, Optional title, @@ -46,10 +48,16 @@ public class UpdatePlaylistRequest { this.title = title; this.summary = summary; } + + public UpdatePlaylistRequest( + double playlistID) { + this(playlistID, Optional.empty(), Optional.empty()); + } /** * the ID of the playlist */ + @JsonIgnore public double playlistID() { return playlistID; } @@ -57,15 +65,19 @@ public class UpdatePlaylistRequest { /** * name of the playlist */ - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional title() { + return (Optional) title; } /** * summary description of the playlist */ - public Optional summary() { - return summary; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional summary() { + return (Optional) summary; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistResponse.java index f2e81062..17594a74 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UpdatePlaylistResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class UpdatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class UpdatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public UpdatePlaylistResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class UpdatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class UpdatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class UpdatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public UpdatePlaylistResponse withObject(UpdatePlaylistResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public UpdatePlaylistResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class UpdatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class UpdatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class UpdatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R return Utils.toString(UpdatePlaylistResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class UpdatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class UpdatePlaylistResponse implements lukehagar.plexapi.plexapi.utils.R this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(UpdatePlaylistResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public UpdatePlaylistResponse build() { return new UpdatePlaylistResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistRequest.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistRequest.java index c7fbf91e..c0121b7a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistRequest.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; @@ -13,7 +15,6 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class UploadPlaylistRequest { /** @@ -38,6 +39,7 @@ public class UploadPlaylistRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=force") private Force force; + @JsonCreator public UploadPlaylistRequest( String path, Force force) { @@ -56,6 +58,7 @@ public class UploadPlaylistRequest { * The GUID of each playlist is based on the filename. * */ + @JsonIgnore public String path() { return path; } @@ -67,6 +70,7 @@ public class UploadPlaylistRequest { * 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. * */ + @JsonIgnore public Force force() { return force; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistResponse.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistResponse.java index dddb3935..e059feb4 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistResponse.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/UploadPlaylistResponse.java @@ -4,17 +4,17 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; import java.lang.Deprecated; import java.math.BigDecimal; import java.math.BigInteger; import java.net.http.HttpResponse; -import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class UploadPlaylistResponse implements lukehagar.plexapi.plexapi.utils.Response { /** @@ -32,29 +32,23 @@ public class UploadPlaylistResponse implements lukehagar.plexapi.plexapi.utils.R */ private HttpResponse rawResponse; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - private Optional object; - + @JsonCreator public UploadPlaylistResponse( String contentType, int statusCode, - HttpResponse rawResponse, - Optional object) { + HttpResponse rawResponse) { 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; } /** * HTTP response content type for this operation */ + @JsonIgnore public String contentType() { return contentType; } @@ -62,6 +56,7 @@ public class UploadPlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * HTTP response status code for this operation */ + @JsonIgnore public int statusCode() { return statusCode; } @@ -69,17 +64,11 @@ public class UploadPlaylistResponse implements lukehagar.plexapi.plexapi.utils.R /** * Raw HTTP response; suitable for custom response parsing */ + @JsonIgnore public HttpResponse rawResponse() { return rawResponse; } - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Optional object() { - return object; - } - public final static Builder builder() { return new Builder(); } @@ -110,24 +99,6 @@ public class UploadPlaylistResponse implements lukehagar.plexapi.plexapi.utils.R this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public UploadPlaylistResponse withObject(UploadPlaylistResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public UploadPlaylistResponse withObject(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -141,8 +112,7 @@ public class UploadPlaylistResponse implements lukehagar.plexapi.plexapi.utils.R return java.util.Objects.deepEquals(this.contentType, other.contentType) && java.util.Objects.deepEquals(this.statusCode, other.statusCode) && - java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && - java.util.Objects.deepEquals(this.object, other.object); + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); } @Override @@ -150,8 +120,7 @@ public class UploadPlaylistResponse implements lukehagar.plexapi.plexapi.utils.R return java.util.Objects.hash( contentType, statusCode, - rawResponse, - object); + rawResponse); } @Override @@ -159,8 +128,7 @@ public class UploadPlaylistResponse implements lukehagar.plexapi.plexapi.utils.R return Utils.toString(UploadPlaylistResponse.class, "contentType", contentType, "statusCode", statusCode, - "rawResponse", rawResponse, - "object", object); + "rawResponse", rawResponse); } public final static class Builder { @@ -169,9 +137,7 @@ public class UploadPlaylistResponse implements lukehagar.plexapi.plexapi.utils.R private Integer statusCode; - private HttpResponse rawResponse; - - private Optional object = Optional.empty(); + private HttpResponse rawResponse; private Builder() { // force use of static builder() method @@ -203,31 +169,12 @@ public class UploadPlaylistResponse implements lukehagar.plexapi.plexapi.utils.R this.rawResponse = rawResponse; return this; } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(UploadPlaylistResponseBody object) { - Utils.checkNotNull(object, "object"); - this.object = Optional.ofNullable(object); - return this; - } - - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - */ - public Builder object(Optional object) { - Utils.checkNotNull(object, "object"); - this.object = object; - return this; - } public UploadPlaylistResponse build() { return new UploadPlaylistResponse( contentType, statusCode, - rawResponse, - object); + rawResponse); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Upscale.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Upscale.java index 75a2a997..b3acefe0 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Upscale.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Upscale.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/User.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/User.java index 5487b55e..c23f0362 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/User.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/User.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,84 +18,44 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class User { @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; + private Optional id; + @JsonCreator public User( - @JsonProperty("id") Optional id, - @JsonProperty("thumb") Optional thumb, - @JsonProperty("title") Optional title) { + @JsonProperty("id") Optional id) { Utils.checkNotNull(id, "id"); - Utils.checkNotNull(thumb, "thumb"); - Utils.checkNotNull(title, "title"); this.id = id; - this.thumb = thumb; - this.title = title; + } + + public User() { + this(Optional.empty()); } - public Optional id() { - return id; - } - - public Optional thumb() { - return thumb; - } - - public Optional title() { - return title; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; } public final static Builder builder() { return new Builder(); } - public User withId(String id) { + public User withId(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); return this; } - public User withId(Optional id) { + public User withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } - - public User withThumb(String thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = Optional.ofNullable(thumb); - return this; - } - - public User withThumb(Optional thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = thumb; - return this; - } - - public User withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - public User withTitle(Optional title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -105,80 +67,44 @@ public class User { } User other = (User) o; return - java.util.Objects.deepEquals(this.id, other.id) && - java.util.Objects.deepEquals(this.thumb, other.thumb) && - java.util.Objects.deepEquals(this.title, other.title); + java.util.Objects.deepEquals(this.id, other.id); } @Override public int hashCode() { return java.util.Objects.hash( - id, - thumb, - title); + id); } @Override public String toString() { return Utils.toString(User.class, - "id", id, - "thumb", thumb, - "title", title); + "id", id); } public final static class Builder { - private Optional id = Optional.empty(); - - private Optional thumb = Optional.empty(); - - private Optional title = Optional.empty(); + private Optional id = Optional.empty(); private Builder() { // force use of static builder() method } - public Builder id(String id) { + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); return this; } - public Builder id(Optional id) { + public Builder id(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } - - public Builder thumb(String thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = Optional.ofNullable(thumb); - return this; - } - - public Builder thumb(Optional thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = thumb; - return this; - } - - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } public User build() { return new User( - id, - thumb, - title); + id); } } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Writer.java b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Writer.java index 4862a13b..77c8d0da 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/operations/Writer.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/operations/Writer.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.operations; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +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; @@ -16,21 +18,27 @@ import java.math.BigInteger; import java.util.Optional; import lukehagar.plexapi.plexapi.utils.Utils; - public class Writer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonCreator public Writer( @JsonProperty("tag") Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; } + + public Writer() { + this(Optional.empty()); + } - public Optional tag() { - return tag; + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tag() { + return (Optional) tag; } public final static Builder builder() { diff --git a/src/main/java/lukehagar/plexapi/plexapi/models/shared/Security.java b/src/main/java/lukehagar/plexapi/plexapi/models/shared/Security.java index 610b2e1e..57d26724 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/models/shared/Security.java +++ b/src/main/java/lukehagar/plexapi/plexapi/models/shared/Security.java @@ -4,7 +4,9 @@ package lukehagar.plexapi.plexapi.models.shared; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; import java.io.InputStream; @@ -14,18 +16,19 @@ import java.math.BigInteger; import lukehagar.plexapi.plexapi.utils.SpeakeasyMetadata; import lukehagar.plexapi.plexapi.utils.Utils; - public class Security { @SpeakeasyMetadata("security:scheme=true,type=apiKey,subtype=header,name=X-Plex-Token") private String accessToken; + @JsonCreator public Security( String accessToken) { Utils.checkNotNull(accessToken, "accessToken"); this.accessToken = accessToken; } + @JsonIgnore public String accessToken() { return accessToken; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/BackoffStrategy.java b/src/main/java/lukehagar/plexapi/plexapi/utils/BackoffStrategy.java index d44a3841..6c078a6e 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/BackoffStrategy.java +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/BackoffStrategy.java @@ -5,7 +5,6 @@ package lukehagar.plexapi.plexapi.utils; import java.util.concurrent.TimeUnit; -import lukehagar.plexapi.plexapi.utils.Utils; /** * Exponential Backoff Strategy with Jitter @@ -65,7 +64,7 @@ public class BackoffStrategy { } /** - * @deprecated use baseFactor instead. + * @deprecated use {@link #baseFactor()} instead. */ @Deprecated public double exponent() { @@ -169,8 +168,8 @@ public class BackoffStrategy { /** * Sets the backoff base factor. * - * @deprecated use baseFactor instead. - * @param exponent The base factor to use. + * @deprecated use {@link #baseFactor(double)} instead. + * @param baseFactor The base factor to use. * @return The builder instance. */ @Deprecated diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/EventStream.java b/src/main/java/lukehagar/plexapi/plexapi/utils/EventStream.java new file mode 100644 index 00000000..0430e72e --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/EventStream.java @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.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 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. + * + * @param the type that the SSE {@code data} field is deserialized into + */ +/** + * @param + */ +public final class EventStream implements AutoCloseable { + + private final EventStreamReader reader; + private final TypeReference typeReference; + private final ObjectMapper mapper; + + // Internal use only + public EventStream(InputStream in, TypeReference typeReference, ObjectMapper mapper) { + this.reader = new EventStreamReader(in); + this.typeReference = typeReference; + this.mapper = mapper; + } + + /** + * Returns the next message. If another message does not exist returns + * {@code Optional.empty()}. + * + * @return the next message or {@code Optional.empty()} if no more messages + * @throws IOException + */ + public Optional next() throws IOException { + return reader.readMessage() // + .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() { + try { + return stream().collect(Collectors.toList()); + } finally { + try { + close(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + /** + * 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) { + try { + next = EventStream.this.next(); + } catch (IOException e) { + throw new UncheckedIOException(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(); + } + +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamLineReader.java b/src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamLineReader.java new file mode 100644 index 00000000..50ca9601 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamLineReader.java @@ -0,0 +1,71 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.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/lukehagar/plexapi/plexapi/utils/EventStreamMessage.java b/src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamMessage.java new file mode 100644 index 00000000..c5a760b6 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamMessage.java @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.utils; + +import java.util.Optional; + +public class EventStreamMessage { + + private final Optional event; + private final Optional id; + private final Optional retryMs; + private final String data; + + public EventStreamMessage(Optional event, Optional id, Optional retryMs, String data) { + if (data == null) { + throw new IllegalArgumentException("data cannot be null"); + } + this.event = event; + this.id = id; + this.retryMs = retryMs; + this.data = data; + } + + public Optional event() { + return event; + } + + public Optional id() { + return id; + } + + public Optional retryMs() { + return retryMs; + } + + public String data() { + return data; + } + + public boolean isEmpty() { + return !event.isPresent() && !id().isPresent() && !retryMs().isPresent() && data.isEmpty(); + } + + @Override + public String toString() { + StringBuilder b = new StringBuilder(); + event.ifPresent(value -> b.append("event: " + value + "\n")); + id.ifPresent(value -> b.append("id: " + value + "\n")); + retryMs.ifPresent(value -> b.append("retry: " + value + "\n")); + if (!data.isEmpty()) { + b.append("data: " + data); + } + return b.toString(); + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamReader.java b/src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamReader.java new file mode 100644 index 00000000..f1bcc6fa --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/EventStreamReader.java @@ -0,0 +1,156 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.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/lukehagar/plexapi/plexapi/utils/HTTPClient.java b/src/main/java/lukehagar/plexapi/plexapi/utils/HTTPClient.java index c2d306ea..c458ce3a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/HTTPClient.java +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/HTTPClient.java @@ -8,8 +8,25 @@ import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; import java.net.http.HttpResponse; +import java.net.http.HttpRequest; public interface HTTPClient { - public HttpResponse send(HTTPRequest request) + + /** + * Sends an HTTP request and returns the response. + * + *

Note that {@link HttpRequest} is immutable. To modify the request you can use + * {@link 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; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/HTTPRequest.java b/src/main/java/lukehagar/plexapi/plexapi/utils/HTTPRequest.java index d4e69468..7623f36a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/HTTPRequest.java +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/HTTPRequest.java @@ -4,50 +4,58 @@ package lukehagar.plexapi.plexapi.utils; -import java.net.URI; +import java.net.URISyntaxException; import java.net.http.HttpRequest; import java.net.http.HttpRequest.BodyPublisher; import java.net.http.HttpRequest.BodyPublishers; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import org.apache.http.NameValuePair; -import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.message.BasicNameValuePair; public class HTTPRequest { - private String baseURL; - private String method; - private SerializedBody body; - private List queryParams = new ArrayList<>(); - private Map> headers = new HashMap<>(); + private final String baseURL; + private final String method; + private final List queryParams = new ArrayList<>(); + private final Map> headers = new HashMap<>(); + private Optional body = Optional.empty(); // mutable - public HTTPRequest setMethod(String method) { + public HTTPRequest(String baseURL, String method) { + Utils.checkNotNull(baseURL, "baseURL"); + Utils.checkNotNull(method, "method"); + this.baseURL = baseURL; this.method = method; - return this; } - - public HTTPRequest setURL(String url) { - this.baseURL = url; - return this; - } - - public HTTPRequest setBody(SerializedBody body) { + + public void setBody(Optional body) { + Utils.checkNotNull(body, "body"); this.body = body; - return this; } - + public HTTPRequest addHeader(String key, String value) { - List headerValues = this.headers.get(key); + List headerValues = headers.get(key); if (headerValues == null) { headerValues = new ArrayList<>(); + headers.put(key, headerValues); } - headerValues.add(value); - this.headers.put(key, headerValues); + return this; + } + + public HTTPRequest addHeaders(Map> map) { + map.forEach((key, list) -> list.forEach(v -> addHeader(key, v))); + return this; + } + + public HTTPRequest addQueryParam(String name, String value) { + addQueryParam(new BasicNameValuePair(name, value)); return this; } @@ -55,33 +63,32 @@ public class HTTPRequest { this.queryParams.add(param); return this; } + + public HTTPRequest addQueryParams(Collection params) { + params.forEach(p -> addQueryParam(p)); + return this; + } public HttpRequest build() { HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(); - BodyPublisher bodyPublisher = BodyPublishers.noBody(); - if (this.body != null) { - bodyPublisher = this.body.body; - requestBuilder.header("Content-Type", this.body.contentType); + final BodyPublisher bodyPublisher; + if (body.isPresent()) { + bodyPublisher = body.get().body(); + requestBuilder.header("Content-Type", body.get().contentType()); + } else { + bodyPublisher = BodyPublishers.noBody(); } - - requestBuilder.method(this.method, bodyPublisher); - requestBuilder.uri(resolveURL()); - - for (Map.Entry> entry : this.headers.entrySet()) { - for (String value : entry.getValue()) { - requestBuilder.header(entry.getKey(), value); - } + requestBuilder.method(method, bodyPublisher); + try { + URIBuilder b = new URIBuilder(this.baseURL); + queryParams.forEach(pair -> b.addParameter(pair.getName(), pair.getValue())); + requestBuilder.uri(b.build()); + } catch (URISyntaxException e) { + throw new RuntimeException(e); } - + headers.forEach((k, list) -> list.forEach(v -> requestBuilder.header(k, v))); return requestBuilder.build(); } - private URI resolveURL() { - String url = this.baseURL; - if (this.queryParams != null && this.queryParams.size() > 0) { - url += "?" + URLEncodedUtils.format(this.queryParams, StandardCharsets.UTF_8); - } - return URI.create(url); - } } \ No newline at end of file diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/Helpers.java b/src/main/java/lukehagar/plexapi/plexapi/utils/Helpers.java new file mode 100644 index 00000000..93056b17 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/Helpers.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.utils; + +import java.net.http.HttpRequest; +import java.util.function.BiPredicate; + +/** + * Public helper methods for use by customers and end-users. + * + */ +public final class Helpers { + + /** + * Returns an {@link HttpRequest.Builder} which is initialized with the + * state of the given {@link HttpRequest}. + * + *

Note that headers can be added and modified but not removed. To + * remove headers use {@link #copy(HttpRequest, BiPredicate)} (which applies + * a filter to the headers while copying). + * + *

Note also that this method is redundant from JDK 16 because the + * method {@code HttpRequest.newBuilder(HttpRequest)} is available. + * + * @param request request to copy + * @return a builder initialized with values from {@code request} + */ + public static HttpRequest.Builder copy(HttpRequest request) { + return Utils.copy(request); + } + + /** + * Returns an {@link HttpRequest.Builder} which is initialized with the + * state of the given {@link HttpRequest}. + * + *

Note that this method is redundant from JDK 16 because the + * method {@code HttpRequest.newBuilder(HttpRequest, BiPredicate)} is available. + + * @param request request to copy + * @param filter selects which header key-values to include in the copied request + * @return a builder initialized with values from {@code request} + */ + public static HttpRequest.Builder copy(HttpRequest request, BiPredicate filter) { + return Utils.copy(request, filter); + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/Hook.java b/src/main/java/lukehagar/plexapi/plexapi/utils/Hook.java new file mode 100644 index 00000000..433d2cee --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/Hook.java @@ -0,0 +1,272 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.utils; + +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.net.http.HttpRequest; +import java.util.List; +import java.util.Optional; +import java.util.UUID; + +import lukehagar.plexapi.plexapi.SecuritySource; + +/** + * Holder class for hook-associated types. This class does not get + * instantiated. + */ +public final class Hook { + + private Hook() { + // prevent instantiation + } + + /** + * Context for a hook call. + */ + public interface HookContext { + String operationId(); + Optional> oauthScopes(); + Optional securitySource(); + } + + /** + * Context for a BeforeRequest hook call. + */ + public interface BeforeRequestContext extends HookContext { + } + + public static final class BeforeRequestContextImpl implements BeforeRequestContext { + + private final String operationId; + private final Optional> oauthScopes; + private final Optional securitySource; + + public BeforeRequestContextImpl(String operationId, Optional> oauthScopes, Optional securitySource) { + this.operationId = operationId; + this.oauthScopes = oauthScopes; + this.securitySource = securitySource; + } + + @Override + public String operationId() { + return operationId; + } + + @Override + public Optional securitySource() { + return securitySource; + } + + @Override + public Optional> oauthScopes() { + return oauthScopes; + } + } + + /** + * Context for an AfterSuccess hook call. + */ + public interface AfterSuccessContext extends HookContext { + } + + public static final class AfterSuccessContextImpl implements AfterSuccessContext { + + private final String operationId; + private final Optional> oauthScopes; + private final Optional securitySource; + + public AfterSuccessContextImpl(String operationId, Optional> oauthScopes, Optional securitySource) { + Utils.checkNotNull(securitySource, "securitySource"); + this.operationId = operationId; + this.oauthScopes = oauthScopes; + this.securitySource = securitySource; + } + + @Override + public String operationId() { + return operationId; + } + + @Override + public Optional securitySource() { + return securitySource; + } + + @Override + public Optional> oauthScopes() { + return oauthScopes; + } + } + + /** + * Context for an AfterError hook call. + */ + public interface AfterErrorContext extends HookContext { + } + + public static final class AfterErrorContextImpl implements AfterErrorContext { + + private final String operationId; + private final Optional> oauthScopes; + private final Optional securitySource; + + public AfterErrorContextImpl(String operationId, Optional> oauthScopes, Optional securitySource) { + Utils.checkNotNull(securitySource, "securitySource"); + this.operationId = operationId; + this.oauthScopes = oauthScopes; + this.securitySource = securitySource; + } + + @Override + public String operationId() { + return operationId; + } + + @Override + public Optional securitySource() { + return securitySource; + } + + @Override + public Optional> oauthScopes() { + return oauthScopes; + } + } + + /** + * Specifies how a request is transformed before sending. + */ + public interface BeforeRequest { + + /** + * Transforms the given {@link HttpRequest} before sending. + * + *

Note that {@link HttpRequest} is immutable. To modify the request you can use + * {@link 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 + * @throws Exception on error + */ + HttpRequest beforeRequest(BeforeRequestContext context, HttpRequest request) throws Exception; + + /** + * The default action is to return the request untouched. + */ + static BeforeRequest DEFAULT = (context, request) -> request; + } + + /** + * Specifies how a response is transformed before response processing. + */ + 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 + * @throws Exception on error + */ + HttpResponse afterSuccess(AfterSuccessContext context, HttpResponse response) + throws Exception; + + /** + * The default action is to return the response untouched. + */ + static AfterSuccess DEFAULT = (context, response) -> response; + } + + /** + * Specifies what happens if a request action throws an Exception. + */ + 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 + * @throws Exception if error to be propagated + */ + HttpResponse afterError( + AfterErrorContext context, + Optional> response, + Optional error) throws Exception; + + /** + * The default action is to rethrow the given error. + */ + static AfterError DEFAULT = (context, response, error) -> { + Utils.checkArgument( + response.isPresent() ^ error.isPresent(), + "one and only one of response or error must be present"); + if (error.isPresent()) { + throw error.get(); + } else { + return response.get(); + } + }; + } + + public static final class SdkInitData { + private final String baseUrl; + private final HTTPClient client; + + public SdkInitData(String baseUrl, HTTPClient client) { + this.baseUrl = baseUrl; + this.client = client; + } + + public String baseUrl() { + return baseUrl; + } + + public HTTPClient client() { + return client; + } + } + + /** + * Transforms the HTTPClient before use. + */ + public interface SdkInit { + + /** + * Returns a transformed {@link HTTPClient} and {@code baseUrl} for use in requests. + * + * @param data data to transform + * @return the transformed data + */ + SdkInitData sdkInit(SdkInitData data); + + /** + * The default action is to return the client untouched. + */ + static SdkInit DEFAULT = data -> data; + + } + + public static final class IdempotencyHook implements BeforeRequest { + + @Override + public HttpRequest beforeRequest(BeforeRequestContext context, HttpRequest request) throws Exception { + HttpRequest.Builder b = Helpers.copy(request); + b.header("Idempotency-Key", UUID.randomUUID().toString()); + return b.build(); + } + } +} diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/Hooks.java b/src/main/java/lukehagar/plexapi/plexapi/utils/Hooks.java new file mode 100644 index 00000000..40589935 --- /dev/null +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/Hooks.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package lukehagar.plexapi.plexapi.utils; + +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.net.http.HttpRequest; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CopyOnWriteArrayList; + +import lukehagar.plexapi.plexapi.utils.Hook.AfterError; +import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContext; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccess; +import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContext; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequest; +import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContext; +import lukehagar.plexapi.plexapi.utils.Hook.SdkInit; +import lukehagar.plexapi.plexapi.utils.Hook.SdkInitData; + +/** + * Registers hooks for use at runtime by an end-user or for use by a customer + * that may edit the SDKHooks.java file. + * + *

+ * For example, this code will add a transaction id header to every request: + * + *

+ * hooks.registerBeforeRequest((context, request) -> {
+ *     request.headers().map().put("acme-transaction-id", nextTransactionId());
+ *     return request;
+ * });
+ * 
+ */ +// ThreadSafe +public class Hooks implements BeforeRequest, AfterSuccess, AfterError, SdkInit { + + // we use CopyOnWriteArrayList for thread safety + private final List beforeRequestHooks = new CopyOnWriteArrayList<>(); + private final List afterSuccessHooks = new CopyOnWriteArrayList<>(); + private final List afterErrorHooks = new CopyOnWriteArrayList<>(); + private final List SdkInitHooks = new CopyOnWriteArrayList<>(); + + /** + * Constructor. + */ + public Hooks() { + } + + /** + * Registers a {@link BeforeRequest} hook to be applied in order of + * registration. The result of the first BeforeRequest hook will be passed to + * the second BeforeRequest hook and processed similarly for the rest of the + * registered hooks. If a BeforeRequest hook throws then that Exception will + * not be passed to the {@link AfterError} hooks. + * + * @param beforeRequest hook to be registered + * @return this + */ + public Hooks registerBeforeRequest(BeforeRequest beforeRequest) { + Utils.checkNotNull(beforeRequest, "beforeRequest"); + this.beforeRequestHooks.add(beforeRequest); + return this; + } + + /** + * Registers an {@link AfterSuccess} hook to be applied in order of registration + * (multiple can be registered). The result of the first AfterSuccess hook will + * be passed to the second AfterSuccess hook and processed similarly for the + * rest of the registered hooks. If an AfterSuccess hook throws then that + * Exception will not be passed to the {@link AfterError} hooks. + * + * @param afterSuccess hook to be registered + * @return this + */ + public Hooks registerAfterSuccess(AfterSuccess afterSuccess) { + Utils.checkNotNull(afterSuccess, "afterSuccess"); + this.afterSuccessHooks.add(afterSuccess); + return this; + } + + /** + * Registers an {@link AfterError} hook to be applied in order of registration + * (multiple can be registered). If the first AfterError hook throws then the + * second hook will be called with that exception (and no response object) and + * so on for the rest of the registered hooks. If an AfterError hook returns + * normally then its result will be passed through to the next AfterError hook + * with the latest thrown Exception. + * + * @param afterError hook to be registered + * @return this + */ + public Hooks registerAfterError(AfterError afterError) { + Utils.checkNotNull(afterError, "afterError"); + this.afterErrorHooks.add(afterError); + return this; + } + + /** + * Registers a {@link SdkInit} hook to be applied in order of registration + * (multiple can be registered). + * + * @param SdkInit hook to be registered + * @return this + */ + public Hooks registerSdkInit(SdkInit SdkInit) { + Utils.checkNotNull(SdkInit, "SdkInit"); + this.SdkInitHooks.add(SdkInit); + return this; + } + + @Override + public HttpRequest beforeRequest(BeforeRequestContext context, HttpRequest request) throws Exception { + Utils.checkNotNull(context, "context"); + Utils.checkNotNull(request, "request"); + for (BeforeRequest hook : beforeRequestHooks) { + request = hook.beforeRequest(context, request); + } + return request; + } + + @Override + public HttpResponse afterSuccess(AfterSuccessContext context, HttpResponse response) + throws Exception { + Utils.checkNotNull(context, "context"); + Utils.checkNotNull(response, "response"); + + for (AfterSuccess hook : afterSuccessHooks) { + response = hook.afterSuccess(context, response); + if (response == null) { + throw new IllegalStateException("afterSuccess cannot return null"); + } + } + return response; + } + + @Override + public HttpResponse afterError( + AfterErrorContext context, + Optional> response, + Optional error) throws Exception { + Utils.checkNotNull(context, "context"); + Utils.checkNotNull(response, "response"); + Utils.checkNotNull(error, "error"); + Utils.checkArgument( + response.isPresent() ^ error.isPresent(), + "one and only one of response or error must be present"); + + for (AfterError hook : afterErrorHooks) { + try { + response = Optional.ofNullable(hook.afterError(context, response, error)); + if (!response.isPresent()) { + throw new IllegalStateException( + "afterError must either throw an exception or return a non-null response"); + } + } catch (FailEarlyException e) { + Throwable cause = e.getCause(); + if (cause instanceof Exception) { + throw (Exception) cause; + } else { + // must be an Error + throw (Error) cause; + } + } catch (Exception e) { + error = Optional.of(e); + response = Optional.empty(); + } + } + if (response.isPresent()) { + return response.get(); + } else { + throw error.get(); + } + } + + @Override + public SdkInitData sdkInit(SdkInitData data) { + Utils.checkNotNull(data, "data"); + for (SdkInit hook : SdkInitHooks) { + data = hook.sdkInit(data); + if (data == null) { + throw new IllegalStateException("sdkInit cannot return null"); + } + } + return data; + } + + @SuppressWarnings("serial") + public static final class FailEarlyException extends RuntimeException { + public FailEarlyException(Exception e) { + super(e); + } + } + +} \ No newline at end of file diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/RequestBody.java b/src/main/java/lukehagar/plexapi/plexapi/utils/RequestBody.java index 6ceed2b0..4b8a7844 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/RequestBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/RequestBody.java @@ -6,13 +6,11 @@ package lukehagar.plexapi.plexapi.utils; import java.io.IOException; import java.io.InputStream; +import java.io.UncheckedIOException; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.net.http.HttpRequest.BodyPublishers; -import java.time.LocalDate; -import java.time.OffsetDateTime; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.regex.Pattern; @@ -30,7 +28,7 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.databind.ObjectMapper; -public class RequestBody { +public final class RequestBody { private static final Map SERIALIZATION_METHOD_TO_CONTENT_TYPE = Map.of( "json", "application/json", "form", "application/x-www-form-urlencoded", @@ -38,6 +36,10 @@ public class RequestBody { "raw", "application/octet-stream", "string", "text/plain"); + private RequestBody() { + // prevent instantiation + } + public static SerializedBody serialize(Object request, String requestField, String serializationMethod, boolean nullable) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException, UnsupportedOperationException, IOException { @@ -88,18 +90,17 @@ public class RequestBody { Pattern formPattern = Pattern.compile("application\\/x-www-form-urlencoded.*"); Pattern textPattern = Pattern.compile("text\\/plain"); - SerializedBody body = new SerializedBody(); + final SerializedBody body; if (textPattern.matcher(contentType).matches()) { - body.contentType = contentType; - body.body = BodyPublishers.ofString(value.toString()); + body = new SerializedBody(contentType, BodyPublishers.ofString(value.toString())); } else if (jsonPattern.matcher(contentType).matches()) { ObjectMapper mapper = JSON.getMapper(); - body.contentType = contentType; if (value instanceof JsonNullable && !((JsonNullable) value).isPresent()) { - body.body = BodyPublishers.noBody(); + body = new SerializedBody(contentType, BodyPublishers.noBody()); } else { - body.body = BodyPublishers.ofString(mapper.writeValueAsString(value)); + body = new SerializedBody(contentType, + BodyPublishers.ofString(mapper.writeValueAsString(value))); } } else if (multipartPattern.matcher(contentType).matches()) { body = serializeMultipart(value); @@ -107,16 +108,13 @@ public class RequestBody { body = serializeFormData(value); } else { if (value instanceof String) { - body.contentType = contentType; - body.body = BodyPublishers.ofString((String) value); + body = new SerializedBody(contentType, BodyPublishers.ofString((String) value)); } else if (value instanceof byte[]) { - body.contentType = contentType; - body.body = BodyPublishers.ofByteArray((byte[]) value); + body = new SerializedBody(contentType, BodyPublishers.ofByteArray((byte[]) value)); } else { throw new RuntimeException("Unsupported content type " + contentType + " for field " + fieldName); } } - return body; } @@ -164,15 +162,14 @@ public class RequestBody { } HttpEntity entity = builder.build(); - - SerializedBody body = new SerializedBody(); - body.contentType = builder.build().getContentType().getValue(); - - InputStream stream = entity.getContent(); - - body.body = BodyPublishers.ofInputStream(() -> stream); - - return body; + String ct = builder.build().getContentType().getValue(); + return new SerializedBody(ct, BodyPublishers.ofInputStream(() -> { + try { + return entity.getContent(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + })); } private static void serializeMultipartFile(MultipartEntityBuilder builder, Object file) @@ -215,7 +212,7 @@ public class RequestBody { builder.addBinaryBody(fieldName, content, ContentType.APPLICATION_OCTET_STREAM, fileName); } - private static SerializedBody serializeFormData(Object value) + public static SerializedBody serializeFormData(Object value) throws IOException, IllegalArgumentException, IllegalAccessException { List params = new ArrayList<>(); @@ -341,17 +338,15 @@ public class RequestBody { } UrlEncodedFormEntity entity = new UrlEncodedFormEntity(params); - - SerializedBody body = new SerializedBody(); - body.contentType = entity.getContentType().getValue(); - - InputStream stream = entity.getContent(); - - body.body = BodyPublishers.ofInputStream(() -> stream); - - return body; - } - - private RequestBody() { + String ct = entity.getContentType().getValue(); + // ensure that a fresh open input stream is provided every time + // by the BodyPublisher + return new SerializedBody(ct, BodyPublishers.ofInputStream(() -> { + try { + return entity.getContent(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + })); } } \ No newline at end of file diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/Retries.java b/src/main/java/lukehagar/plexapi/plexapi/utils/Retries.java index e604e838..f4540f02 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/Retries.java +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/Retries.java @@ -36,28 +36,31 @@ public class Retries { this.statusCodes = statusCodes; } - private class NonRetryableException extends Exception { - private Exception exception; - - public Exception exception() { - return exception; - } + @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; + } } - private class RetryableException extends Exception { - private HttpResponse response; - - public HttpResponse response() { - return response; - } + @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 { diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/Security.java b/src/main/java/lukehagar/plexapi/plexapi/utils/Security.java index 461ddaee..f0f1a984 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/Security.java +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/Security.java @@ -4,17 +4,19 @@ package lukehagar.plexapi.plexapi.utils; + import java.lang.reflect.Field; import java.util.Base64; import org.apache.http.message.BasicNameValuePair; -public class Security { - public static SpeakeasyHTTPSecurityClient createClient(HTTPClient client, Object security) - throws Exception { - - SpeakeasyHTTPSecurityClient securityClient = new SpeakeasyHTTPSecurityClient(client); - +public final class Security { + + private Security() { + // prevent instantiation + } + + public static HTTPRequest configureSecurity(HTTPRequest request, Object security) throws Exception { if (security != null) { Field[] fields = security.getClass().getDeclaredFields(); @@ -31,24 +33,21 @@ public class Security { } if (securityMetadata.option) { - parseSecurityOption(securityClient, value); - return securityClient; + parseSecurityOption(request, value); } else if (securityMetadata.scheme) { if ((securityMetadata.subtype != null && securityMetadata.subtype.equals("basic")) && Types.getType(value.getClass()) != Types.OBJECT) { - parseSecurityScheme(securityClient, securityMetadata, security); - return securityClient; + parseSecurityScheme(request, securityMetadata, security); } else { - parseSecurityScheme(securityClient, securityMetadata, value); + parseSecurityScheme(request, securityMetadata, value); } } } } - - return securityClient; + return request; } - private static void parseSecurityOption(SpeakeasyHTTPSecurityClient client, Object option) + private static void parseSecurityOption(HTTPRequest request, Object option) throws Exception { Field[] fields = option.getClass().getDeclaredFields(); @@ -65,16 +64,16 @@ public class Security { continue; } - parseSecurityScheme(client, securityMetadata, value); + parseSecurityScheme(request, securityMetadata, value); } } - private static void parseSecurityScheme(SpeakeasyHTTPSecurityClient client, SecurityMetadata schemeMetadata, + private static void parseSecurityScheme(HTTPRequest requestBuilder, SecurityMetadata schemeMetadata, Object scheme) throws Exception { if (Types.getType(scheme.getClass()) == Types.OBJECT) { if (schemeMetadata.type.equals("http") && schemeMetadata.subtype.equals("basic")) { - parseBasicAuthScheme(client, scheme); + parseBasicAuthScheme(requestBuilder, scheme); return; } @@ -93,28 +92,28 @@ public class Security { continue; } - parseSecuritySchemeValue(client, schemeMetadata, securityMetadata, value); + parseSecuritySchemeValue(requestBuilder, schemeMetadata, securityMetadata, value); } } else { - parseSecuritySchemeValue(client, schemeMetadata, schemeMetadata, scheme); + parseSecuritySchemeValue(requestBuilder, schemeMetadata, schemeMetadata, scheme); } } - private static void parseSecuritySchemeValue(SpeakeasyHTTPSecurityClient client, SecurityMetadata schemeMetadata, + private static void parseSecuritySchemeValue(HTTPRequest request, SecurityMetadata schemeMetadata, SecurityMetadata securityMetadata, Object value) throws Exception { switch (schemeMetadata.type) { case "apiKey": switch (schemeMetadata.subtype) { case "header": - client.addHeader(securityMetadata.name, Utils.valToString(value)); + request.addHeader(securityMetadata.name, Utils.valToString(value)); break; case "query": - client.addQueryParam( - new BasicNameValuePair(securityMetadata.name, Utils.valToString(value))); + request.addQueryParam( + securityMetadata.name, Utils.valToString(value)); break; case "cookie": - client.addHeader("Cookie", + request.addHeader("Cookie", String.format("%s=%s", securityMetadata.name, Utils.valToString(value))); break; default: @@ -123,15 +122,15 @@ public class Security { } break; case "openIdConnect": - client.addHeader(securityMetadata.name, Utils.prefixBearer(Utils.valToString(value))); + request.addHeader(securityMetadata.name, Utils.prefixBearer(Utils.valToString(value))); break; case "oauth2": - client.addHeader(securityMetadata.name, Utils.prefixBearer(Utils.valToString(value))); + request.addHeader(securityMetadata.name, Utils.prefixBearer(Utils.valToString(value))); break; case "http": switch (schemeMetadata.subtype) { case "bearer": - client.addHeader(securityMetadata.name, Utils.prefixBearer(Utils.valToString(value))); + request.addHeader(securityMetadata.name, Utils.prefixBearer(Utils.valToString(value))); break; default: throw new RuntimeException("Unsupported security scheme subtype for bearer"); @@ -142,7 +141,7 @@ public class Security { } } - private static void parseBasicAuthScheme(SpeakeasyHTTPSecurityClient client, Object scheme) + private static void parseBasicAuthScheme(HTTPRequest requestBuilder, Object scheme) throws IllegalAccessException { Field[] fields = scheme.getClass().getDeclaredFields(); @@ -174,10 +173,7 @@ public class Security { } } - client.addHeader("Authorization", + requestBuilder.addHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(String.format("%s:%s", username, password).getBytes())); } - - private Security() { - } } \ No newline at end of file diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/SerializedBody.java b/src/main/java/lukehagar/plexapi/plexapi/utils/SerializedBody.java index ee06b249..fff4ecde 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/SerializedBody.java +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/SerializedBody.java @@ -7,6 +7,22 @@ package lukehagar.plexapi.plexapi.utils; import java.net.http.HttpRequest.BodyPublisher; public class SerializedBody { - public String contentType; - public BodyPublisher body; + + private final String contentType; + private final BodyPublisher body; + + public SerializedBody(String contentType, BodyPublisher body) { + Utils.checkNotNull(contentType, "content"); + Utils.checkNotNull(body, "body"); + this.contentType = contentType; + this.body = body; + } + + public String contentType() { + return contentType; + } + + public BodyPublisher body() { + return body; + } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyHTTPClient.java b/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyHTTPClient.java index d30c4bb9..f7cce85a 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyHTTPClient.java +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyHTTPClient.java @@ -12,14 +12,11 @@ import java.net.http.HttpResponse; import java.io.InputStream; public class SpeakeasyHTTPClient implements HTTPClient { + @Override - public HttpResponse send(HTTPRequest request) + public HttpResponse send(HttpRequest request) throws IOException, InterruptedException, URISyntaxException { HttpClient client = HttpClient.newHttpClient(); - - HttpRequest req = request.build(); - - HttpResponse response = client.send(req, HttpResponse.BodyHandlers.ofInputStream()); - return response; + return client.send(request, HttpResponse.BodyHandlers.ofInputStream()); } } diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyHTTPSecurityClient.java b/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyHTTPSecurityClient.java deleted file mode 100644 index e31b015c..00000000 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyHTTPSecurityClient.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package lukehagar.plexapi.plexapi.utils; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.net.http.HttpResponse; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.http.NameValuePair; - -public class SpeakeasyHTTPSecurityClient - implements HTTPClient { - - private HTTPClient client; - - private List queryParams = new ArrayList<>(); - private Map> headers = new HashMap<>(); - - public SpeakeasyHTTPSecurityClient(HTTPClient client) { - this.client = client; - } - - @Override - public HttpResponse send(HTTPRequest request) - throws IOException, InterruptedException, URISyntaxException { - - for (Map.Entry> entry : this.headers.entrySet()) { - for (String value : entry.getValue()) { - request.addHeader(entry.getKey(), value); - } - } - - for (NameValuePair param : this.queryParams) { - request.addQueryParam(param); - } - - return this.client.send(request); - } - - public void addHeader(String key, String value) { - List headerValues = this.headers.get(key); - if (headerValues == null) { - headerValues = new ArrayList<>(); - } - - headerValues.add(value); - this.headers.put(key, headerValues); - } - - public void addQueryParam(NameValuePair param) { - this.queryParams.add(param); - } - -} diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyMetadata.java b/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyMetadata.java index b735818b..7987b1ee 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyMetadata.java +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/SpeakeasyMetadata.java @@ -12,5 +12,5 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface SpeakeasyMetadata { - public String value() default ""; + String value() default ""; } diff --git a/src/main/java/lukehagar/plexapi/plexapi/utils/Utils.java b/src/main/java/lukehagar/plexapi/plexapi/utils/Utils.java index 3b32adfd..8c19aa8f 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/utils/Utils.java +++ b/src/main/java/lukehagar/plexapi/plexapi/utils/Utils.java @@ -5,11 +5,17 @@ package lukehagar.plexapi.plexapi.utils; import java.io.InputStream; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.lang.reflect.Field; import java.math.BigDecimal; import java.math.BigInteger; +import java.net.URI; import java.net.URLEncoder; +import java.net.http.HttpClient.Version; +import java.net.http.HttpHeaders; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -17,9 +23,11 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.concurrent.Callable; +import java.util.function.BiPredicate; import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.NoSuchElementException; @@ -30,6 +38,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.StreamSupport; +import javax.net.ssl.SSLSession; + import org.apache.commons.io.IOUtils; import org.apache.http.NameValuePair; @@ -38,7 +48,11 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.IntNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; import com.fasterxml.jackson.databind.type.TypeFactory; public final class Utils { @@ -101,7 +115,7 @@ public final class Utils { Object value = params != null ? field.get(params) : null; value = resolveOptionals(value); - value = Utils.populateGlobal(value, field.getName(), "pathParam", globals); + value = populateGlobal(value, field.getName(), "pathParam", globals); if (value == null) { continue; } @@ -184,7 +198,7 @@ public final class Utils { return baseURL + templateUrl(path, pathParams); } - public static boolean matchContentType(String contentType, String pattern) { + public static boolean contentTypeMatches(String contentType, String pattern) { if (contentType == null || contentType.isBlank()) { return false; } @@ -256,8 +270,8 @@ public final class Utils { return QueryParameters.parseQueryParams(type, params, globals); } - public static HTTPClient configureSecurityClient(HTTPClient client, Object security) throws Exception { - return Security.createClient(client, security); + public static HTTPRequest configureSecurity(HTTPRequest request, Object security) throws Exception { + return Security.configureSecurity(request, security); } public static String templateUrl(String url, Map params) { @@ -279,9 +293,9 @@ public final class Utils { return sb.toString(); } - public static Map> getHeaders(Object headers) throws Exception { + public static Map> getHeadersFromMetadata(Object headers, Map>> globals) throws Exception { if (headers == null) { - return null; + return Collections.emptyMap(); } Map> result = new HashMap<>(); @@ -297,6 +311,8 @@ public final class Utils { Object value = field.get(headers); value = resolveOptionals(value); + value = populateGlobal(value, field.getName(), "header", globals); + if (value == null) { continue; } @@ -467,6 +483,12 @@ public final class Utils { return object; } + public static void checkArgument(boolean expression, String message) { + if (!expression) { + throw new IllegalArgumentException(message); + } + } + public static Map emptyMapIfNull(Map map) { return map == null ? java.util.Collections.emptyMap() : map; } @@ -785,4 +807,220 @@ public final class Utils { throw new RuntimeException(e); } } -} \ No newline at end of file + + public static boolean statusCodeMatches(int statusCode, String... expectedStatusCodes) { + return Arrays.stream(expectedStatusCodes) + .anyMatch(expected -> statusCodeMatchesOne(statusCode, expected)); + } + + // VisibleForTesting + public static boolean statusCodeMatchesOne(int statusCode, String expectedStatusCode) { + checkNotNull(expectedStatusCode, "expectedStatusCode"); + if (expectedStatusCode.toLowerCase(Locale.ENGLISH).equals("default")) { + return true; + } + if (statusCode < 100 || statusCode >= 600) { + throw new IllegalArgumentException("unexpected http status code: " + statusCode); + } + if (expectedStatusCode.length() != 3) { + return false; + } + String firstDigit = String.valueOf(statusCode / 100); + String firstDigitExpected = expectedStatusCode.substring(0, 1); + if (!firstDigit.equals(firstDigitExpected)) { + return false; + } else if (expectedStatusCode.toUpperCase(Locale.ENGLISH).endsWith("XX")) { + return true; + } else { + return expectedStatusCode.equals(String.valueOf(statusCode)); + } + } + + /** + * Returns an {@link HttpRequest.Builder} which is initialized with the + * state of the given {@link HttpRequest}. + * + * @param request request to copy + * @return a builder initialized with values from {@code request} + */ + public static HttpRequest.Builder copy(HttpRequest request) { + return copy(request, (k, v) -> true); + } + + /** + * Returns an {@link HttpRequest.Builder} which is initialized with the + * state of the given {@link HttpRequest}. + * + * @param request request to copy + * @param filter selects which header key-values to include in the copied request + * @return a builder initialized with values from {@code request} + */ + public static HttpRequest.Builder copy(HttpRequest request, BiPredicate filter) { + // in JDK 16+ we can use this + // return HttpRequest.newBuilder(request, (k, v) -> true); + checkNotNull(request, "request"); + + final HttpRequest.Builder builder = HttpRequest.newBuilder(); + builder.uri(request.uri()); + builder.expectContinue(request.expectContinue()); + + request.headers() + .map() + .forEach((name, values) -> + values.stream() + .filter(v -> filter.test(name, v)) + .forEach(value -> builder.header(name, value))); + + request.version().ifPresent(builder::version); + request.timeout().ifPresent(builder::timeout); + var method = request.method(); + request.bodyPublisher().ifPresentOrElse( + // if body is present, set it + bodyPublisher -> builder.method(method, bodyPublisher), + // otherwise, the body is absent, special case for GET/DELETE, + // or else use empty body + () -> { + switch (method) { + case "GET": builder.GET();break; + case "DELETE" : builder.DELETE();break; + default : builder.method(method, HttpRequest.BodyPublishers.noBody()); + } + } + ); + return builder; + } + + // convenience method so that classes don't need to import a possibly colliding name of JSON + // (Utils is a very common import) + public static ObjectMapper mapper() { + return JSON.getMapper(); + } + + public static T asType(EventStreamMessage x, ObjectMapper mapper, TypeReference typeReference) { + try { + try { + String json = json(x, mapper, false); + return mapper.readValue(json, typeReference); + } catch (JsonProcessingException e) { + // retry with the assumption that data field is plain text + String json = json(x, mapper, true); + return mapper.readValue(json, typeReference); + } + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + public static String json(EventStreamMessage m, ObjectMapper mapper, boolean dataIsPlainText) + throws JsonProcessingException { + ObjectNode node = mapper.createObjectNode(); + m.event().ifPresent(value -> node.set("event", new TextNode(value))); + m.id().ifPresent(value -> node.set("id", new TextNode(value))); + m.retryMs().ifPresent(value -> node.set("retry", new IntNode(value))); + // data is always present (but may be an empty string) + if (dataIsPlainText || m.data().trim().isEmpty()) { + node.set("data", new TextNode(m.data())); + } else { + JsonNode tree = mapper.readTree(m.data()); + node.set("data", tree); + } + return mapper.writeValueAsString(node); + } + + /** + * Fully reads the body of the given response and caches it in memory. The + * returned response has utility methods to view the body + * ({@code bodyAsUtf8(), bodyAsBytes()} and the {@code body()} method can be + * called multiple times, each returning a fresh {@link InputStream} that will + * read from the cached byte array. + * + *

+ * This method is most likely to be used in a diagnostic/logging situtation so + * that the contents of a response can be viewed without affecting processing. + * Using this method with a very large body may be problematic in + * terms of memory use. + * + * @param response response to cache + * @return response with a cached body + * @throws IOException + */ + public static HttpResponseCached cache(HttpResponse response) throws IOException { + return new HttpResponseCached(response); + } + + public static final class HttpResponseCached implements HttpResponse { + + private final HttpResponse response; + private final byte[] bytes; + + public HttpResponseCached(HttpResponse response) throws IOException { + this.response = response; + this.bytes = Utils.toByteArrayAndClose(response.body()); + } + + public String bodyAsUtf8() { + return new String(bytes, StandardCharsets.UTF_8); + } + + public byte[] bodyAsBytes() { + return bytes; + } + + @Override + public int statusCode() { + return response.statusCode(); + } + + @Override + public HttpRequest request() { + return response.request(); + } + + @Override + public Optional> previousResponse() { + return response.previousResponse(); + } + + @Override + public HttpHeaders headers() { + return response.headers(); + } + + @Override + public InputStream body() { + return new ByteArrayInputStream(bytes); + } + + @Override + public Optional sslSession() { + return response.sslSession(); + } + + @Override + public URI uri() { + return response.uri(); + } + + @Override + public Version version() { + return response.version(); + } + + @Override + public String toString() { + return response.toString(); + } + } + + private static final char[] HEX_ARRAY = "0123456789abcdef".toCharArray(); + + public static String bytesToLowerCaseHex(byte[] bytes) { + char[] hexChars = new char[bytes.length * 2]; + for (int j = 0; j < bytes.length; j++) { + int v = bytes[j] & 0xFF; + hexChars[j * 2] = HEX_ARRAY[v >>> 4]; + hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F]; + } + return new String(hexChars); + } +}